This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new cbdef66757 [test](join)add join case5 #12854
cbdef66757 is described below

commit cbdef6675709cc887b0fbee9bf07abae351c3404
Author: zy-kkk <zhong...@qq.com>
AuthorDate: Tue Sep 27 15:48:36 2022 +0800

    [test](join)add join case5 #12854
---
 regression-test/data/query/join/test_join3.out     | 28 +++++++
 .../suites/query/join/test_join2.groovy            |  4 +-
 .../suites/query/join/test_join3.groovy            | 96 ++++++++++++++++++++++
 .../suites/query/join/test_join4.groovy            |  4 +-
 4 files changed, 128 insertions(+), 4 deletions(-)

diff --git a/regression-test/data/query/join/test_join3.out 
b/regression-test/data/query/join/test_join3.out
new file mode 100644
index 0000000000..e7a6efa415
--- /dev/null
+++ b/regression-test/data/query/join/test_join3.out
@@ -0,0 +1,28 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !join1 --
+\N     \N      \N      \N      dd      33
+\N     \N      cc      22      cc      23
+\N     \N      ee      42      \N      \N
+bb     11      bb      12      bb      13
+
+-- !join2 --
+bb     12      bb      13
+cc     22      cc      23
+
+-- !join3 --
+bb     12      bb      13
+cc     22      cc      23
+ee     42      \N      \N
+
+-- !join4 --
+\N     \N      dd      33
+bb     12      bb      13
+cc     22      cc      23
+ee     42      \N      \N
+
+-- !join7 --
+\N     \N      bb      2
+\N     \N      cc      2
+\N     \N      ee      2
+bb     11      \N      2
+
diff --git a/regression-test/suites/query/join/test_join2.groovy 
b/regression-test/suites/query/join/test_join2.groovy
index 60feb3207f..9070eeb82f 100644
--- a/regression-test/suites/query/join/test_join2.groovy
+++ b/regression-test/suites/query/join/test_join2.groovy
@@ -16,7 +16,7 @@
 // under the License.
 
 suite("test_join2", "query,p0") {
-    def DBname = "test_join2"
+    def DBname = "regression_test_join2"
     def TBname1 = "J1_TBL"
     def TBname2 = "J2_TBL"
 
@@ -158,4 +158,4 @@ suite("test_join2", "query,p0") {
     sql "DROP TABLE IF EXISTS ${TBname1};"
     sql "DROP TABLE IF EXISTS ${TBname2};"
     sql "DROP DATABASE IF EXISTS ${DBname};"
-}
\ No newline at end of file
+}
diff --git a/regression-test/suites/query/join/test_join3.groovy 
b/regression-test/suites/query/join/test_join3.groovy
new file mode 100644
index 0000000000..20a567b3a7
--- /dev/null
+++ b/regression-test/suites/query/join/test_join3.groovy
@@ -0,0 +1,96 @@
+// 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_join3", "query,p0") {
+    def DBname = "regression_test_join3"
+    sql "DROP DATABASE IF EXISTS ${DBname}"
+    sql "CREATE DATABASE IF NOT EXISTS ${DBname}"
+    sql "use ${DBname}"
+
+    def tbName1 = "t1"
+    def tbName2 = "t2"
+    def tbName3 = "t3"
+
+    sql """CREATE TABLE ${tbName1} (name varchar(255), n INTEGER) DISTRIBUTED 
BY HASH(name) properties("replication_num" = "1");"""
+    sql """CREATE TABLE ${tbName2} (name varchar(255), n INTEGER) DISTRIBUTED 
BY HASH(name) properties("replication_num" = "1");"""
+    sql """CREATE TABLE ${tbName3} (name varchar(255), n INTEGER) DISTRIBUTED 
BY HASH(name) properties("replication_num" = "1");"""
+
+    sql "INSERT INTO ${tbName1} VALUES ( 'bb', 11 );"
+    sql "INSERT INTO ${tbName2} VALUES ( 'bb', 12 );"
+    sql "INSERT INTO ${tbName2} VALUES ( 'cc', 22 );"
+    sql "INSERT INTO ${tbName2} VALUES ( 'ee', 42 );"
+    sql "INSERT INTO ${tbName3} VALUES ( 'bb', 13 );"
+    sql "INSERT INTO ${tbName3} VALUES ( 'cc', 23 );"
+    sql "INSERT INTO ${tbName3} VALUES ( 'dd', 33 );"
+
+    qt_join1 """
+            SELECT * FROM ${tbName1} FULL JOIN ${tbName2} USING (name) FULL 
JOIN ${tbName3} USING (name) ORDER BY 1,2,3,4,5,6;
+        """
+    qt_join2 """
+            SELECT * FROM
+            (SELECT * FROM ${tbName2}) as s2
+            INNER JOIN
+            (SELECT * FROM ${tbName3}) s3
+            USING (name)
+            ORDER BY 1,2,3,4;
+        """
+    qt_join3 """
+            SELECT * FROM
+            (SELECT * FROM ${tbName2}) as s2
+            LEFT JOIN
+            (SELECT * FROM ${tbName3}) s3
+            USING (name)
+            ORDER BY 1,2,3,4;
+        """
+    qt_join4 """
+            SELECT * FROM
+            (SELECT * FROM ${tbName2}) as s2
+            FULL JOIN
+            (SELECT * FROM ${tbName3}) s3
+            USING (name)
+            ORDER BY 1,2,3,4;
+        """
+
+// wait fix
+//     qt_join5 """
+//             SELECT * FROM
+//             (SELECT name, n as s2_n, 2 as s2_2 FROM ${tbName2}) as s2
+//             NATURAL INNER JOIN
+//             (SELECT name, n as s3_n, 3 as s3_2 FROM ${tbName3}) s3
+//             ORDER BY 1,2,3,4;
+//         """
+
+//     qt_join6 """
+//             SELECT * FROM
+//             (SELECT name, n as s1_n, 1 as s1_1 FROM ${tbName1}) as s1
+//             NATURAL INNER JOIN
+//             (SELECT name, n as s2_n, 2 as s2_2 FROM ${tbName2}) as s2
+//             NATURAL INNER JOIN
+//             (SELECT name, n as s3_n, 3 as s3_2 FROM ${tbName3}) s3;
+//         """
+
+    qt_join7 """
+        SELECT * FROM
+          (SELECT name, n as s1_n FROM ${tbName1}) as s1
+        FULL JOIN
+          (SELECT name, 2 as s2_n FROM ${tbName2}) as s2
+        ON (s1_n = s2_n)
+        ORDER BY 1,2,3,4;
+        """
+
+    sql "DROP DATABASE IF EXISTS ${DBname}"
+}
diff --git a/regression-test/suites/query/join/test_join4.groovy 
b/regression-test/suites/query/join/test_join4.groovy
index 41838d554f..668b14ceac 100644
--- a/regression-test/suites/query/join/test_join4.groovy
+++ b/regression-test/suites/query/join/test_join4.groovy
@@ -16,7 +16,7 @@
 // under the License.
 
 suite("test_join4", "query,p0") {
-    def DBname = "test_join4"
+    def DBname = "regression_test_join4"
     sql "DROP DATABASE IF EXISTS ${DBname}"
     sql "CREATE DATABASE IF NOT EXISTS ${DBname}"
     sql "use ${DBname}"
@@ -56,4 +56,4 @@ suite("test_join4", "query,p0") {
     sql "DROP TABLE IF EXISTS ${tbName1};"
     sql "DROP TABLE IF EXISTS ${tbName2};"
     sql "DROP DATABASE IF EXISTS ${DBname};"
-}
\ No newline at end of file
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to