From 19c1b309f45edc65df2231e5d12d11e7bbcb3d1b Mon Sep 17 00:00:00 2001 From: BiteTheDDDDt <952130278@qq.com> Date: Thu, 31 Mar 2022 12:09:01 +0800 Subject: [PATCH 1/4] fix some bug of like adjust error info add regression-test delete generated file resolve conflit --- .licenserc.yaml | 3 +- .../org/apache/doris/analysis/Analyzer.java | 2 - .../apache/doris/analysis/LikePredicate.java | 12 +++-- .../org/apache/doris/catalog/FunctionSet.java | 10 ++-- .../apache/doris/catalog/ScalarFunction.java | 18 ++++--- .../rewrite/RewriteLikePredicateRule.java | 50 ------------------- .../common/load/test_basic_agg.sql | 1 + .../common/table/test_basic_agg.sql | 26 ++++++++++ .../test_select_with_predicate_like.out | 21 ++++++++ .../sql/avg_decimal.sql.generated.out | 4 ++ ...as_right_tale_left_outer.sql.generated.out | 5 ++ .../correctness/test_select_constant.groovy | 19 ++++++- .../test_select_with_predicate_like.groovy | 35 +++++++++++++ .../suites/demo/connect_action.groovy | 17 +++++++ .../suites/demo/event_action.groovy | 17 +++++++ .../suites/demo/explain_action.groovy | 17 +++++++ .../suites/demo/lazyCheck_action.groovy | 17 +++++++ regression-test/suites/demo/qt_action.groovy | 17 +++++++ .../demo/select_union_all_action.groovy | 17 +++++++ regression-test/suites/demo/sql_action.groovy | 17 +++++++ .../suites/demo/streamLoad_action.groovy | 17 +++++++ .../suites/demo/test_action.groovy | 17 +++++++ .../suites/demo/thread_action.groovy | 17 +++++++ .../suites/demo/timer_action.groovy | 17 +++++++ .../suites/empty_table/load.groovy | 1 - regression-test/suites/join/load.groovy | 1 - ..._output_as_right_tale_left_outer_order.sql | 2 +- .../test_streamload_perfomance.groovy | 19 ++++++- 28 files changed, 342 insertions(+), 74 deletions(-) delete mode 100644 fe/fe-core/src/main/java/org/apache/doris/rewrite/RewriteLikePredicateRule.java create mode 100644 regression-test/common/load/test_basic_agg.sql create mode 100644 regression-test/common/table/test_basic_agg.sql create mode 100644 regression-test/data/correctness/test_select_with_predicate_like.out create mode 100644 regression-test/data/empty_table/sql/avg_decimal.sql.generated.out create mode 100644 regression-test/data/join/sql/agg_output_as_right_tale_left_outer.sql.generated.out create mode 100644 regression-test/suites/correctness/test_select_with_predicate_like.groovy diff --git a/.licenserc.yaml b/.licenserc.yaml index b9a6a6e6875766..4d707463450389 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -32,6 +32,7 @@ header: - '**/*.md5' - '**/*.patch' - '**/*.log' + - '**/*.sql' - 'tsan_suppressions' - 'docs/.markdownlintignore' - 'fe/fe-core/src/test/resources/data/net_snmp_normal' @@ -52,8 +53,6 @@ header: - 'be/src/util/sse2neon.h' - 'be/src/util/utf8_check.cpp' - 'build-support/run_clang_format.py' - - 'regression-test/common' - - 'regression-test/suites' - 'regression-test/data' comment: on-failure diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java index 8b5ebab306d97b..0e3ed6d39b0c88 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java @@ -49,7 +49,6 @@ import org.apache.doris.rewrite.RewriteBinaryPredicatesRule; import org.apache.doris.rewrite.RewriteEncryptKeyRule; import org.apache.doris.rewrite.RewriteFromUnixTimeRule; -import org.apache.doris.rewrite.RewriteLikePredicateRule; import org.apache.doris.rewrite.RewriteDateLiteralRule; import org.apache.doris.rewrite.mvrewrite.CountDistinctToBitmap; import org.apache.doris.rewrite.mvrewrite.CountDistinctToBitmapOrHLLRule; @@ -311,7 +310,6 @@ public GlobalState(Catalog catalog, ConnectContext context) { rules.add(RewriteDateLiteralRule.INSTANCE); rules.add(RewriteEncryptKeyRule.INSTANCE); rules.add(RewriteAliasFunctionRule.INSTANCE); - rules.add(RewriteLikePredicateRule.INSTANCE); List onceRules = Lists.newArrayList(); onceRules.add(ExtractCommonFactorsRule.INSTANCE); onceRules.add(InferFiltersRule.INSTANCE); diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/LikePredicate.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/LikePredicate.java index 97d8f2afdd9a35..8d72c2a112eae2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/LikePredicate.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/LikePredicate.java @@ -113,14 +113,16 @@ protected void toThrift(TExprNode msg) { @Override public void analyzeImpl(Analyzer analyzer) throws AnalysisException { super.analyzeImpl(analyzer); - if (!getChild(0).getType().isStringType() && !getChild(0).getType().isFixedPointType() - && !getChild(0).getType().isNull()) { + if (getChild(0).getType().isObjectStored()) { throw new AnalysisException( - "left operand of " + op.toString() + " must be of type STRING or FIXED_POINT_TYPE: " + toSql()); + "left operand of " + op.toString() + " must not be Bitmap or HLL: " + toSql()); } if (!getChild(1).getType().isStringType() && !getChild(1).getType().isNull()) { - throw new AnalysisException( - "right operand of " + op.toString() + " must be of type STRING: " + toSql()); + throw new AnalysisException("right operand of " + op.toString() + " must be of type STRING: " + toSql()); + } + + if (!getChild(0).getType().isStringType()) { + uncheckedCastChild(Type.VARCHAR, 0); } fn = getBuiltinFunction(analyzer, op.toString(), diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java index 0bbc83ffd9ab59..3582a04c9e224f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java @@ -1210,10 +1210,12 @@ public void addBuiltinBothScalaAndVectorized(Function fn) { vecFns = Lists.newArrayList(); vectorizedFunctions.put(fn.functionName(), vecFns); } - ScalarFunction scalarFunction = (ScalarFunction)fn; - vecFns.add(ScalarFunction.createVecBuiltin(scalarFunction.functionName(), scalarFunction.getSymbolName(), - Lists.newArrayList(scalarFunction.getArgs()), scalarFunction.hasVarArgs(), - scalarFunction.getReturnType(), scalarFunction.isUserVisible(), scalarFunction.getNullableMode())); + ScalarFunction scalarFunction = (ScalarFunction) fn; + vecFns.add(ScalarFunction.createVecBuiltin(scalarFunction.functionName(), scalarFunction.getPrepareFnSymbol(), + scalarFunction.getSymbolName(), scalarFunction.getCloseFnSymbol(), + Lists.newArrayList(scalarFunction.getArgs()), scalarFunction.hasVarArgs(), + scalarFunction.getReturnType(), scalarFunction.isUserVisible(), + scalarFunction.getNullableMode())); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarFunction.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarFunction.java index e1f09fb2489239..f8d48094a2868f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarFunction.java @@ -285,16 +285,22 @@ public static ScalarFunction createBuiltin( public static ScalarFunction createVecBuiltinOperator( String name, String symbol, ArrayList argTypes, Type retType, NullableMode nullableMode) { - return createVecBuiltin(name, symbol, argTypes, false, retType, false, nullableMode); + return createVecBuiltin(name, null, symbol, null, argTypes, false, retType, false, nullableMode); } //TODO: This method should not be here, move to other place in the future - public static ScalarFunction createVecBuiltin( - String name, String symbol, ArrayList argTypes, - boolean hasVarArgs, Type retType, boolean userVisible, NullableMode nullableMode) { - ScalarFunction fn = new ScalarFunction( - new FunctionName(name), argTypes, retType, hasVarArgs, userVisible, true); + public static ScalarFunction createVecBuiltin(String name, String prepareFnSymbolBName, String symbol, + String closeFnSymbolName, ArrayList argTypes, boolean hasVarArgs, Type retType, boolean userVisible, + NullableMode nullableMode) { + ScalarFunction fn = new ScalarFunction(new FunctionName(name), argTypes, retType, hasVarArgs, userVisible, + true); + if (prepareFnSymbolBName != null) { + fn.prepareFnSymbol = prepareFnSymbolBName; + } fn.symbolName = symbol; + if (closeFnSymbolName != null) { + fn.closeFnSymbol = closeFnSymbolName; + } fn.nullableMode = nullableMode; return fn; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/rewrite/RewriteLikePredicateRule.java b/fe/fe-core/src/main/java/org/apache/doris/rewrite/RewriteLikePredicateRule.java deleted file mode 100644 index c9679e8a330493..00000000000000 --- a/fe/fe-core/src/main/java/org/apache/doris/rewrite/RewriteLikePredicateRule.java +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package org.apache.doris.rewrite; - -import org.apache.doris.analysis.Analyzer; -import org.apache.doris.analysis.CastExpr; -import org.apache.doris.analysis.Expr; -import org.apache.doris.analysis.LikePredicate; -import org.apache.doris.analysis.SlotRef; -import org.apache.doris.analysis.TypeDef; -import org.apache.doris.catalog.Type; -import org.apache.doris.common.AnalysisException; - -/** - * Rewrite `int` to `string` in like predicate - * in order to support `int` in like predicate, same as MySQL - */ -public class RewriteLikePredicateRule implements ExprRewriteRule { - public static RewriteLikePredicateRule INSTANCE = new RewriteLikePredicateRule(); - - @Override - public Expr apply(Expr expr, Analyzer analyzer, ExprRewriter.ClauseType clauseType) throws AnalysisException { - if (expr instanceof LikePredicate) { - Expr leftChild = expr.getChild(0); - if (leftChild instanceof SlotRef) { - Type type = leftChild.getType(); - if (type.isFixedPointType()) { - return new LikePredicate(((LikePredicate) expr).getOp(), - new CastExpr(new TypeDef(Type.VARCHAR), leftChild), expr.getChild(1)); - } - } - } - return expr; - } -} diff --git a/regression-test/common/load/test_basic_agg.sql b/regression-test/common/load/test_basic_agg.sql new file mode 100644 index 00000000000000..bb794971f4890c --- /dev/null +++ b/regression-test/common/load/test_basic_agg.sql @@ -0,0 +1 @@ +insert into test_basic_agg values(0,0,0,0,0,'0',0,0,0,0,0); \ No newline at end of file diff --git a/regression-test/common/table/test_basic_agg.sql b/regression-test/common/table/test_basic_agg.sql new file mode 100644 index 00000000000000..bd1ca6b2de1b2f --- /dev/null +++ b/regression-test/common/table/test_basic_agg.sql @@ -0,0 +1,26 @@ +CREATE TABLE `test_basic_agg` ( + `k1` tinyint(4) NULL COMMENT "", + `k2` smallint(6) NULL COMMENT "", + `k3` int(11) NULL COMMENT "", + `k4` bigint(20) NULL COMMENT "", + `k5` decimal(9, 3) NULL COMMENT "", + `k6` char(5) NULL COMMENT "", + `k10` date NULL COMMENT "", + `k11` datetime NULL COMMENT "", + `k7` varchar(20) NULL COMMENT "", + `k8` double MAX NULL COMMENT "", + `k9` float SUM NULL COMMENT "" +) ENGINE=OLAP +AGGREGATE KEY(`k1`, `k2`, `k3`, `k4`, `k5`, `k6`, `k10`, `k11`, `k7`) +COMMENT "OLAP" +PARTITION BY RANGE(`k1`) +(PARTITION p1 VALUES [("-128"), ("-64")), +PARTITION p2 VALUES [("-64"), ("0")), +PARTITION p3 VALUES [("0"), ("64")), +PARTITION p4 VALUES [("64"), (MAXVALUE))) +DISTRIBUTED BY HASH(`k1`) BUCKETS 5 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +); \ No newline at end of file diff --git a/regression-test/data/correctness/test_select_with_predicate_like.out b/regression-test/data/correctness/test_select_with_predicate_like.out new file mode 100644 index 00000000000000..887fc1ab4723a0 --- /dev/null +++ b/regression-test/data/correctness/test_select_with_predicate_like.out @@ -0,0 +1,21 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !select_default -- +1 + +-- !select_default2 -- +1 + +-- !select_default3 -- + +-- !select_default4 -- + +-- !select_default -- +1 + +-- !select_default2 -- +1 + +-- !select_default3 -- + +-- !select_default4 -- + diff --git a/regression-test/data/empty_table/sql/avg_decimal.sql.generated.out b/regression-test/data/empty_table/sql/avg_decimal.sql.generated.out new file mode 100644 index 00000000000000..1a9a561cf06947 --- /dev/null +++ b/regression-test/data/empty_table/sql/avg_decimal.sql.generated.out @@ -0,0 +1,4 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !avg_decimal -- +\N + diff --git a/regression-test/data/join/sql/agg_output_as_right_tale_left_outer.sql.generated.out b/regression-test/data/join/sql/agg_output_as_right_tale_left_outer.sql.generated.out new file mode 100644 index 00000000000000..c9cf5c57570681 --- /dev/null +++ b/regression-test/data/join/sql/agg_output_as_right_tale_left_outer.sql.generated.out @@ -0,0 +1,5 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !agg_output_as_right_tale_left_outer -- +1 1 +2 2 + diff --git a/regression-test/suites/correctness/test_select_constant.groovy b/regression-test/suites/correctness/test_select_constant.groovy index 6368d3208304b8..787a4a32a3cb2e 100644 --- a/regression-test/suites/correctness/test_select_constant.groovy +++ b/regression-test/suites/correctness/test_select_constant.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("test_select_constant") { qt_select1 'select 100, "test", date("2021-01-02")' -} \ No newline at end of file +} diff --git a/regression-test/suites/correctness/test_select_with_predicate_like.groovy b/regression-test/suites/correctness/test_select_with_predicate_like.groovy new file mode 100644 index 00000000000000..9491c4271ca530 --- /dev/null +++ b/regression-test/suites/correctness/test_select_with_predicate_like.groovy @@ -0,0 +1,35 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +suite("test_select_with_predicate_like") { + def tables=["test_basic_agg"] + + for (String table in tables) { + sql """drop table if exists ${table};""" + sql new File("""regression-test/common/table/${table}.sql""").text + sql new File("""regression-test/common/load/${table}.sql""").text + } + + + qt_select_default "select 1 from test_basic_agg where 1998 like '1%';" + qt_select_default2 "select 1 from test_basic_agg where '1998' like '1%';" + qt_select_default3 "select 1 from test_basic_agg where 2998 like '1%';" + qt_select_default4 "select 1 from test_basic_agg where '2998' like '1%';" + qt_select_default "select 1 from test_basic_agg where 199.8 like '1%';" + qt_select_default2 "select 1 from test_basic_agg where '199.8' like '1%';" + qt_select_default3 "select 1 from test_basic_agg where 299.8 like '1%';" + qt_select_default4 "select 1 from test_basic_agg where '299.8' like '1%';" +} \ No newline at end of file diff --git a/regression-test/suites/demo/connect_action.groovy b/regression-test/suites/demo/connect_action.groovy index ba85cda770e945..5d86fb26a350dc 100644 --- a/regression-test/suites/demo/connect_action.groovy +++ b/regression-test/suites/demo/connect_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("connect_action", "demo") { logger.info("ok") def result1 = connect(user = 'admin', password = context.config.jdbcPassword, url = context.config.jdbcUrl) { diff --git a/regression-test/suites/demo/event_action.groovy b/regression-test/suites/demo/event_action.groovy index 45938729f35b6a..b55e38f38a4af3 100644 --- a/regression-test/suites/demo/event_action.groovy +++ b/regression-test/suites/demo/event_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("event_action", "demo") { def createTable = { tableName -> sql """ diff --git a/regression-test/suites/demo/explain_action.groovy b/regression-test/suites/demo/explain_action.groovy index ca0ec6e8b63515..80b8a2902d4829 100644 --- a/regression-test/suites/demo/explain_action.groovy +++ b/regression-test/suites/demo/explain_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("explain_action", "demo") { explain { sql("select 100") diff --git a/regression-test/suites/demo/lazyCheck_action.groovy b/regression-test/suites/demo/lazyCheck_action.groovy index 377217dc60a408..91b14068ccadd0 100644 --- a/regression-test/suites/demo/lazyCheck_action.groovy +++ b/regression-test/suites/demo/lazyCheck_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("lazyCheck_action_exceptions", "demo") { /***** 1. lazy check exceptions *****/ diff --git a/regression-test/suites/demo/qt_action.groovy b/regression-test/suites/demo/qt_action.groovy index da6251377cfad0..02898075490a14 100644 --- a/regression-test/suites/demo/qt_action.groovy +++ b/regression-test/suites/demo/qt_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("qt_action", "demo") { /** * qt_xxx sql equals to quickTest(xxx, sql) witch xxx is tag. diff --git a/regression-test/suites/demo/select_union_all_action.groovy b/regression-test/suites/demo/select_union_all_action.groovy index 1964b83582a96e..a85b0515766f88 100644 --- a/regression-test/suites/demo/select_union_all_action.groovy +++ b/regression-test/suites/demo/select_union_all_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("select_union_all_action", "demo") { // 3 rows and 1 column def rows = [3, 1, 10] diff --git a/regression-test/suites/demo/sql_action.groovy b/regression-test/suites/demo/sql_action.groovy index 66802f366943bb..73a33b495058b2 100644 --- a/regression-test/suites/demo/sql_action.groovy +++ b/regression-test/suites/demo/sql_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("sql_action", "demo") { // execute sql and ignore result sql "show databases" diff --git a/regression-test/suites/demo/streamLoad_action.groovy b/regression-test/suites/demo/streamLoad_action.groovy index cc131128d10e4b..c12ce81fa5728f 100644 --- a/regression-test/suites/demo/streamLoad_action.groovy +++ b/regression-test/suites/demo/streamLoad_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("streamLoad_action", "demo") { def tableName = "test_streamload_action1" diff --git a/regression-test/suites/demo/test_action.groovy b/regression-test/suites/demo/test_action.groovy index 54615f3ed44235..eb13c49feb56aa 100644 --- a/regression-test/suites/demo/test_action.groovy +++ b/regression-test/suites/demo/test_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("test_action", "demo") { test { sql "abcdefg" diff --git a/regression-test/suites/demo/thread_action.groovy b/regression-test/suites/demo/thread_action.groovy index afa6765a457d4b..26bbedec9d75c8 100644 --- a/regression-test/suites/demo/thread_action.groovy +++ b/regression-test/suites/demo/thread_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("thread_action", "demo") { def (_, elapsedMillis) = timer { /** diff --git a/regression-test/suites/demo/timer_action.groovy b/regression-test/suites/demo/timer_action.groovy index 3d4f15069c6e43..c55743ab1345c7 100644 --- a/regression-test/suites/demo/timer_action.groovy +++ b/regression-test/suites/demo/timer_action.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("timer_action", "demo") { def (sumResult, elapsedMillis) = timer { long sum = 0 diff --git a/regression-test/suites/empty_table/load.groovy b/regression-test/suites/empty_table/load.groovy index 6b8cd7a3b7416b..76d184e3d7fa14 100644 --- a/regression-test/suites/empty_table/load.groovy +++ b/regression-test/suites/empty_table/load.groovy @@ -1,4 +1,3 @@ - // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information diff --git a/regression-test/suites/join/load.groovy b/regression-test/suites/join/load.groovy index 404d85fc962249..a80a00e6158759 100644 --- a/regression-test/suites/join/load.groovy +++ b/regression-test/suites/join/load.groovy @@ -1,4 +1,3 @@ - // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information diff --git a/regression-test/suites/join/sql/agg_output_as_right_tale_left_outer_order.sql b/regression-test/suites/join/sql/agg_output_as_right_tale_left_outer_order.sql index 23a1ff45cd64b5..cb69a7a2e4282c 100644 --- a/regression-test/suites/join/sql/agg_output_as_right_tale_left_outer_order.sql +++ b/regression-test/suites/join/sql/agg_output_as_right_tale_left_outer_order.sql @@ -1 +1 @@ -select t1.k1,t2.k1 from test_join t1 left join (select k1 from test_join group by k1) t2 on t1.k1=t2.k1 +select t1.k1,t2.k1 from test_join t1 left join (select k1 from test_join group by k1) t2 on t1.k1=t2.k1 order by t1.k1 diff --git a/regression-test/suites/performance/test_streamload_perfomance.groovy b/regression-test/suites/performance/test_streamload_perfomance.groovy index 8a5ef4a16cbb4e..8023e52822fa8d 100644 --- a/regression-test/suites/performance/test_streamload_perfomance.groovy +++ b/regression-test/suites/performance/test_streamload_perfomance.groovy @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + suite("test_streamload_perfomance", "performance") { def tableName = "test_streamload_performance1" @@ -10,7 +27,7 @@ suite("test_streamload_perfomance", "performance") { DISTRIBUTED BY HASH(id) BUCKETS 1 PROPERTIES ( "replication_num" = "1" - ) + ) """ def rowCount = 10000 From bc42b2e00a09a47274d14f80f950f488de465edf Mon Sep 17 00:00:00 2001 From: BiteTheDDDDt <952130278@qq.com> Date: Sat, 2 Apr 2022 17:13:09 +0800 Subject: [PATCH 2/4] remove generated file && remove order by --- .../data/empty_table/sql/avg_decimal.sql.generated.out | 4 ---- .../agg_output_as_right_tale_left_outer.sql.generated.out | 5 ----- .../join/sql/agg_output_as_right_tale_left_outer_order.sql | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 regression-test/data/empty_table/sql/avg_decimal.sql.generated.out delete mode 100644 regression-test/data/join/sql/agg_output_as_right_tale_left_outer.sql.generated.out diff --git a/regression-test/data/empty_table/sql/avg_decimal.sql.generated.out b/regression-test/data/empty_table/sql/avg_decimal.sql.generated.out deleted file mode 100644 index 1a9a561cf06947..00000000000000 --- a/regression-test/data/empty_table/sql/avg_decimal.sql.generated.out +++ /dev/null @@ -1,4 +0,0 @@ --- This file is automatically generated. You should know what you did if you want to edit this --- !avg_decimal -- -\N - diff --git a/regression-test/data/join/sql/agg_output_as_right_tale_left_outer.sql.generated.out b/regression-test/data/join/sql/agg_output_as_right_tale_left_outer.sql.generated.out deleted file mode 100644 index c9cf5c57570681..00000000000000 --- a/regression-test/data/join/sql/agg_output_as_right_tale_left_outer.sql.generated.out +++ /dev/null @@ -1,5 +0,0 @@ --- This file is automatically generated. You should know what you did if you want to edit this --- !agg_output_as_right_tale_left_outer -- -1 1 -2 2 - diff --git a/regression-test/suites/join/sql/agg_output_as_right_tale_left_outer_order.sql b/regression-test/suites/join/sql/agg_output_as_right_tale_left_outer_order.sql index cb69a7a2e4282c..134d14d5f50fc3 100644 --- a/regression-test/suites/join/sql/agg_output_as_right_tale_left_outer_order.sql +++ b/regression-test/suites/join/sql/agg_output_as_right_tale_left_outer_order.sql @@ -1 +1 @@ -select t1.k1,t2.k1 from test_join t1 left join (select k1 from test_join group by k1) t2 on t1.k1=t2.k1 order by t1.k1 +select t1.k1,t2.k1 from test_join t1 left join (select k1 from test_join group by k1) t2 on t1.k1=t2.k1 \ No newline at end of file From a2e8b0009e4e5ecb5f38cc8f4edd435a4a844f1e Mon Sep 17 00:00:00 2001 From: BiteTheDDDDt <952130278@qq.com> Date: Wed, 6 Apr 2022 15:41:12 +0800 Subject: [PATCH 3/4] add license head --- .../table_function/explose_json_array.groovy | 81 +++++++++++++++++++ .../table_function/explose_split.groovy | 49 +++++++++++ 2 files changed, 130 insertions(+) create mode 100644 regression-test/suites/table_function/explose_json_array.groovy create mode 100644 regression-test/suites/table_function/explose_split.groovy diff --git a/regression-test/suites/table_function/explose_json_array.groovy b/regression-test/suites/table_function/explose_json_array.groovy new file mode 100644 index 00000000000000..6b7c34d2da15d0 --- /dev/null +++ b/regression-test/suites/table_function/explose_json_array.groovy @@ -0,0 +1,81 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// The cases is copied from +// https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-lateral-view.html +// and modified by Doris. + +def tableName = "person" + +sql """ DROP TABLE IF EXISTS ${tableName} """ +sql """ + CREATE TABLE ${tableName} + (id INT, name STRING, age INT, class INT, address STRING) + UNIQUE KEY(id) DISTRIBUTED BY HASH(id) BUCKETS 8 + PROPERTIES("replication_num" = "1") +""" + +sql """ INSERT INTO ${tableName} VALUES + (100, 'John', 30, 1, 'Street 1'), + (200, 'Mary', NULL, 1, 'Street 2'), + (300, 'Mike', 80, 3, 'Street 3'), + (400, 'Dan', 50, 4, 'Street 4') """ + +sql """ set enable_lateral_view = true """ + +// not vectorized +qt_explose_json_array """ SELECT * FROM ${tableName} + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[30, 60]') t1 as c_age + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[40, 80]') t2 as d_age + ORDER BY id, c_age, d_age """ + +qt_explose_json_array """ SELECT c_age, COUNT(1) FROM ${tableName} + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[30, 60]') t1 as c_age + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[40, 80]') t2 as d_age + GROUP BY c_age ORDER BY c_age """ + +qt_explose_json_array """ SELECT * FROM ${tableName} + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[]') t1 AS c_age + ORDER BY id, c_age """ + +qt_explose_json_array """ SELECT * FROM ${tableName} + LATERAL VIEW EXPLODE_JSON_ARRAY_STRING('[1, "b", 3]') t1 as c + LATERAL VIEW EXPLODE_JSON_ARRAY_DOUBLE('[1.23, 22.214, 214.1]') t2 as d + ORDER BY id, c, d """ + +// vectorized +sql """ set enable_vectorized_engine = true """ + +qt_explose_json_array """ select @@enable_vectorized_engine """ +qt_explose_json_array """ SELECT * FROM ${tableName} + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[30, 60]') t1 as c_age + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[40, 80]') t2 as d_age + ORDER BY id, c_age, d_age """ + +qt_explose_json_array """ SELECT c_age, COUNT(1) FROM ${tableName} + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[30, 60]') t1 as c_age + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[40, 80]') t2 as d_age + GROUP BY c_age ORDER BY c_age """ + +qt_explose_json_array """ SELECT * FROM ${tableName} + LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[]') t1 AS c_age + ORDER BY id, c_age """ + +qt_explose_json_array """ SELECT * FROM ${tableName} + LATERAL VIEW EXPLODE_JSON_ARRAY_STRING('[1, "b", 3]') t1 as c + LATERAL VIEW EXPLODE_JSON_ARRAY_DOUBLE('[1.23, 22.214, 214.1]') t2 as d + ORDER BY id, c, d """ \ No newline at end of file diff --git a/regression-test/suites/table_function/explose_split.groovy b/regression-test/suites/table_function/explose_split.groovy new file mode 100644 index 00000000000000..6772a361bc84bd --- /dev/null +++ b/regression-test/suites/table_function/explose_split.groovy @@ -0,0 +1,49 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +def tableName = "test_lv_str" + +sql """ DROP TABLE IF EXISTS ${tableName} """ +sql """ + CREATE TABLE ${tableName} + (k1 INT, k2 STRING) + UNIQUE KEY(k1) DISTRIBUTED BY HASH(k1) BUCKETS 8 + PROPERTIES("replication_num" = "1") +""" + +sql """ INSERT INTO ${tableName} VALUES (1, 'a,b,c') """ + +sql """ set enable_lateral_view = true """ + +// not_vectorized +qt_explose_split """ select * from ${tableName} + lateral view explode_split(k2, ',') tmp1 as e1 """ + +qt_explose_split """ select * from ${tableName} + lateral view explode_split(k2, ',') tmp1 as e1 + lateral view explode_split(k2, ',') tmp2 as e2 """ + +// vectorized +sql """ set enable_vectorized_engine = true """ + +qt_explose_split """ select * from ${tableName} + lateral view explode_split(k2, ',') tmp1 as e1 """ + +qt_explose_split """ select * from ${tableName} + lateral view explode_split(k2, ',') tmp1 as e1 + lateral view explode_split(k2, ',') tmp2 as e2 """ + From b1cb3176a6e953a4b85dc3347ab02f8476ccb0ae Mon Sep 17 00:00:00 2001 From: BiteTheDDDDt <952130278@qq.com> Date: Thu, 7 Apr 2022 14:23:38 +0800 Subject: [PATCH 4/4] resolve conflict --- .../table_function/explose_json_array.groovy | 81 ------------------- .../table_function/explose_split.groovy | 49 ----------- 2 files changed, 130 deletions(-) delete mode 100644 regression-test/suites/table_function/explose_json_array.groovy delete mode 100644 regression-test/suites/table_function/explose_split.groovy diff --git a/regression-test/suites/table_function/explose_json_array.groovy b/regression-test/suites/table_function/explose_json_array.groovy deleted file mode 100644 index 6b7c34d2da15d0..00000000000000 --- a/regression-test/suites/table_function/explose_json_array.groovy +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// The cases is copied from -// https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-lateral-view.html -// and modified by Doris. - -def tableName = "person" - -sql """ DROP TABLE IF EXISTS ${tableName} """ -sql """ - CREATE TABLE ${tableName} - (id INT, name STRING, age INT, class INT, address STRING) - UNIQUE KEY(id) DISTRIBUTED BY HASH(id) BUCKETS 8 - PROPERTIES("replication_num" = "1") -""" - -sql """ INSERT INTO ${tableName} VALUES - (100, 'John', 30, 1, 'Street 1'), - (200, 'Mary', NULL, 1, 'Street 2'), - (300, 'Mike', 80, 3, 'Street 3'), - (400, 'Dan', 50, 4, 'Street 4') """ - -sql """ set enable_lateral_view = true """ - -// not vectorized -qt_explose_json_array """ SELECT * FROM ${tableName} - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[30, 60]') t1 as c_age - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[40, 80]') t2 as d_age - ORDER BY id, c_age, d_age """ - -qt_explose_json_array """ SELECT c_age, COUNT(1) FROM ${tableName} - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[30, 60]') t1 as c_age - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[40, 80]') t2 as d_age - GROUP BY c_age ORDER BY c_age """ - -qt_explose_json_array """ SELECT * FROM ${tableName} - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[]') t1 AS c_age - ORDER BY id, c_age """ - -qt_explose_json_array """ SELECT * FROM ${tableName} - LATERAL VIEW EXPLODE_JSON_ARRAY_STRING('[1, "b", 3]') t1 as c - LATERAL VIEW EXPLODE_JSON_ARRAY_DOUBLE('[1.23, 22.214, 214.1]') t2 as d - ORDER BY id, c, d """ - -// vectorized -sql """ set enable_vectorized_engine = true """ - -qt_explose_json_array """ select @@enable_vectorized_engine """ -qt_explose_json_array """ SELECT * FROM ${tableName} - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[30, 60]') t1 as c_age - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[40, 80]') t2 as d_age - ORDER BY id, c_age, d_age """ - -qt_explose_json_array """ SELECT c_age, COUNT(1) FROM ${tableName} - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[30, 60]') t1 as c_age - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[40, 80]') t2 as d_age - GROUP BY c_age ORDER BY c_age """ - -qt_explose_json_array """ SELECT * FROM ${tableName} - LATERAL VIEW EXPLODE_JSON_ARRAY_INT('[]') t1 AS c_age - ORDER BY id, c_age """ - -qt_explose_json_array """ SELECT * FROM ${tableName} - LATERAL VIEW EXPLODE_JSON_ARRAY_STRING('[1, "b", 3]') t1 as c - LATERAL VIEW EXPLODE_JSON_ARRAY_DOUBLE('[1.23, 22.214, 214.1]') t2 as d - ORDER BY id, c, d """ \ No newline at end of file diff --git a/regression-test/suites/table_function/explose_split.groovy b/regression-test/suites/table_function/explose_split.groovy deleted file mode 100644 index 6772a361bc84bd..00000000000000 --- a/regression-test/suites/table_function/explose_split.groovy +++ /dev/null @@ -1,49 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -def tableName = "test_lv_str" - -sql """ DROP TABLE IF EXISTS ${tableName} """ -sql """ - CREATE TABLE ${tableName} - (k1 INT, k2 STRING) - UNIQUE KEY(k1) DISTRIBUTED BY HASH(k1) BUCKETS 8 - PROPERTIES("replication_num" = "1") -""" - -sql """ INSERT INTO ${tableName} VALUES (1, 'a,b,c') """ - -sql """ set enable_lateral_view = true """ - -// not_vectorized -qt_explose_split """ select * from ${tableName} - lateral view explode_split(k2, ',') tmp1 as e1 """ - -qt_explose_split """ select * from ${tableName} - lateral view explode_split(k2, ',') tmp1 as e1 - lateral view explode_split(k2, ',') tmp2 as e2 """ - -// vectorized -sql """ set enable_vectorized_engine = true """ - -qt_explose_split """ select * from ${tableName} - lateral view explode_split(k2, ',') tmp1 as e1 """ - -qt_explose_split """ select * from ${tableName} - lateral view explode_split(k2, ',') tmp1 as e1 - lateral view explode_split(k2, ',') tmp2 as e2 """ -