diff --git a/regression-test/suites/join/ddl/left_outer_join.ddl b/regression-test/suites/join/ddl/left_outer_join.ddl new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/regression-test/suites/join/ddl/left_outer_left_table.sql b/regression-test/suites/join/ddl/left_outer_left_table.sql new file mode 100644 index 00000000000000..fb6c93d0457fe9 --- /dev/null +++ b/regression-test/suites/join/ddl/left_outer_left_table.sql @@ -0,0 +1,11 @@ +CREATE TABLE left_outer_left_table ( + `k1` varchar(200) NULL COMMENT "" +) ENGINE=OLAP +UNIQUE KEY(`k1`) +COMMENT "olap" +DISTRIBUTED BY HASH(`k1`) BUCKETS 20 +PROPERTIES ( +"in_memory" = "false", +"storage_format" = "V2", +"replication_num" = "1" +); diff --git a/regression-test/suites/join/ddl/left_outer_right_table.sql b/regression-test/suites/join/ddl/left_outer_right_table.sql new file mode 100644 index 00000000000000..29102b9c5d088d --- /dev/null +++ b/regression-test/suites/join/ddl/left_outer_right_table.sql @@ -0,0 +1,11 @@ +CREATE TABLE left_outer_right_table ( + `k2` varchar(100) NULL COMMENT "" +) ENGINE=OLAP +UNIQUE KEY(`k2`) +COMMENT "olap" +DISTRIBUTED BY HASH(`k2`) BUCKETS 20 +PROPERTIES ( +"in_memory" = "false", +"storage_format" = "V2", +"replication_num" = "1" +); diff --git a/regression-test/suites/join/left_outer_join_explain.groovy b/regression-test/suites/join/left_outer_join_explain.groovy new file mode 100644 index 00000000000000..8416855c7d04b3 --- /dev/null +++ b/regression-test/suites/join/left_outer_join_explain.groovy @@ -0,0 +1,9 @@ +suite("explain_action", "demo") { + explain { + sql("select k2 from left_outer_left_table a left outer join left_outer_right_table b on b.k2 = a.k1 where a.k1='uuid'") + + // contains("OUTPUT EXPRS: 100\n") && contains("PARTITION: UNPARTITIONED\n") + contains "OUTPUT EXPRS: 100\n" + contains "PARTITION: UNPARTITIONED\n" + } +} diff --git a/regression-test/suites/join/load.groovy b/regression-test/suites/join/load.groovy new file mode 100644 index 00000000000000..e3a8525b994f53 --- /dev/null +++ b/regression-test/suites/join/load.groovy @@ -0,0 +1,32 @@ +// 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://github.com/trinodb/trino/tree/master +// /testing/trino-product-tests/src/main/resources/sql-tests/testcases +// and modified by Doris. + +suite("load") { + def tables=["left_outer_right_table", "left_outer_left_table"] + + for (String table in tables) { + sql """ DROP TABLE IF EXISTS $table """ + } + + for (String table in tables) { + sql new File("""${context.file.parent}/ddl/${table}.sql""").text + } +} diff --git a/regression-test/suites/join/sql/left_outer_join_explain.sql b/regression-test/suites/join/sql/left_outer_join_explain.sql new file mode 100644 index 00000000000000..2b27ea9f5fd29f --- /dev/null +++ b/regression-test/suites/join/sql/left_outer_join_explain.sql @@ -0,0 +1 @@ +explain select k2 from left_outer_left_table a left outer join left_outer_right_table b on b.k2 = a.k1 where a.k1='uuid'