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

panxiaolei 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 d2839eb41f [Chore](Materialized-View) add some mv regression test case 
(#18095)
d2839eb41f is described below

commit d2839eb41f6a1288d11887a8aacd5f95c25d05ce
Author: Pxl <pxl...@qq.com>
AuthorDate: Tue Mar 28 10:31:37 2023 +0800

    [Chore](Materialized-View) add some mv regression test case (#18095)
    
    add some mv regression test case
---
 .../testAggQueryOnAggMV1/testAggQueryOnAggMV1.out  |  0
 .../testAggQueryOnAggMV2/testAggQueryOnAggMV2.out  |  0
 .../testAggQueryOnAggMV3/testAggQueryOnAggMV3.out  |  0
 .../testAggTableCountDistinctInBitmapType.out}     | 11 +++---
 .../testSingleMVMultiUsage.out}                    |  3 --
 .../testUnionDistinct/testUnionDistinct.out}       |  1 -
 .../testAggQueryOnAggMV1.groovy                    |  0
 .../testAggQueryOnAggMV2.groovy                    |  0
 .../testAggQueryOnAggMV3.groovy                    |  0
 .../testAggTableCountDistinctInBitmapType.groovy   | 41 ++++++++++++++++++++++
 .../testSingleMVMultiUsage.groovy}                 | 11 +++---
 .../testUnionDistinct/testUnionDistinct.groovy}    | 11 +++---
 12 files changed, 56 insertions(+), 22 deletions(-)

diff --git 
a/regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
similarity index 100%
copy from 
regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
copy to 
regression-test/data/mv_p0/ut/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
diff --git 
a/regression-test/data/mv_p0/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out
similarity index 100%
rename from 
regression-test/data/mv_p0/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out
rename to 
regression-test/data/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.out
diff --git 
a/regression-test/data/mv_p0/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out 
b/regression-test/data/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out
similarity index 100%
rename from 
regression-test/data/mv_p0/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out
rename to 
regression-test/data/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.out
diff --git 
a/regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out 
b/regression-test/data/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.out
similarity index 59%
copy from 
regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
copy to 
regression-test/data/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.out
index 6db240393b..bc9c8312eb 100644
--- a/regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
+++ 
b/regression-test/data/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.out
@@ -1,12 +1,11 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !select_star --
-2020-01-01     1       a       1       1       1
-2020-01-01     1       a       1       1       1
-2020-01-02     2       b       2       2       2
-2020-01-03     3       c       3       3       3
+1      \N
+2      \N
+3      \N
 
 -- !select_mv --
+1      1
 2      1
-2      2
-3      3
+3      1
 
diff --git 
a/regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out 
b/regression-test/data/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.out
similarity index 94%
copy from 
regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
copy to 
regression-test/data/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.out
index 6db240393b..b10e432dad 100644
--- a/regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
+++ 
b/regression-test/data/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.out
@@ -6,7 +6,4 @@
 2020-01-03     3       c       3       3       3
 
 -- !select_mv --
-2      1
-2      2
-3      3
 
diff --git 
a/regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out 
b/regression-test/data/mv_p0/ut/testUnionDistinct/testUnionDistinct.out
similarity index 98%
rename from 
regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
rename to regression-test/data/mv_p0/ut/testUnionDistinct/testUnionDistinct.out
index 6db240393b..cd7fbba9aa 100644
--- a/regression-test/data/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.out
+++ b/regression-test/data/mv_p0/ut/testUnionDistinct/testUnionDistinct.out
@@ -6,7 +6,6 @@
 2020-01-03     3       c       3       3       3
 
 -- !select_mv --
-2      1
 2      2
 3      3
 
diff --git 
a/regression-test/suites/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy
similarity index 100%
copy from 
regression-test/suites/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy
copy to 
regression-test/suites/mv_p0/ut/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy
diff --git 
a/regression-test/suites/mv_p0/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy
similarity index 100%
rename from 
regression-test/suites/mv_p0/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy
rename to 
regression-test/suites/mv_p0/ut/testAggQueryOnAggMV2/testAggQueryOnAggMV2.groovy
diff --git 
a/regression-test/suites/mv_p0/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy 
b/regression-test/suites/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy
similarity index 100%
rename from 
regression-test/suites/mv_p0/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy
rename to 
regression-test/suites/mv_p0/ut/testAggQueryOnAggMV3/testAggQueryOnAggMV3.groovy
diff --git 
a/regression-test/suites/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.groovy
 
b/regression-test/suites/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.groovy
new file mode 100644
index 0000000000..28d7498d9f
--- /dev/null
+++ 
b/regression-test/suites/mv_p0/ut/testAggTableCountDistinctInBitmapType/testAggTableCountDistinctInBitmapType.groovy
@@ -0,0 +1,41 @@
+// 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.
+
+import org.codehaus.groovy.runtime.IOGroovyMethods
+
+suite ("testAggTableCountDistinctInBitmapType") {
+    sql """ DROP TABLE IF EXISTS test_tb; """
+
+    sql """
+            CREATE TABLE test_tb (k1 int, v1 bitmap bitmap_union) Aggregate 
KEY (k1) DISTRIBUTED BY HASH(k1) BUCKETS 3 PROPERTIES ('replication_num' = '1');
+        """
+
+    sql """insert into test_tb values(1,to_bitmap(1));"""
+    sql """insert into test_tb values(2,to_bitmap(2));"""
+    sql """insert into test_tb values(3,to_bitmap(3));"""
+
+
+    qt_select_star "select * from test_tb order by 1;"
+
+
+    explain {
+        sql("select k1, count(distinct v1) from test_tb group by k1;")
+        contains "bitmap_union_count"
+    }
+    qt_select_mv "select k1, count(distinct v1) from test_tb group by k1 order 
by k1;"
+
+}
\ No newline at end of file
diff --git 
a/regression-test/suites/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy 
b/regression-test/suites/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.groovy
similarity index 80%
copy from 
regression-test/suites/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy
copy to 
regression-test/suites/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.groovy
index 1f1802dd75..6634ad798a 100644
--- 
a/regression-test/suites/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy
+++ 
b/regression-test/suites/mv_p0/ut/testSingleMVMultiUsage/testSingleMVMultiUsage.groovy
@@ -17,7 +17,7 @@
 
 import org.codehaus.groovy.runtime.IOGroovyMethods
 
-suite ("testAggQueryOnAggMV1") {
+suite ("testSingleMVMultiUsage") {
     sql """ DROP TABLE IF EXISTS emps; """
 
     sql """
@@ -35,8 +35,7 @@ suite ("testAggQueryOnAggMV1") {
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
-
-    createMV("create materialized view emps_mv as select deptno, sum(salary), 
max(commission) from emps group by deptno ;")
+    createMV("create materialized view emps_mv as select deptno, empid, salary 
from emps order by deptno;")
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
@@ -48,10 +47,10 @@ suite ("testAggQueryOnAggMV1") {
 
 
     explain {
-        sql("select sum(salary), deptno from emps group by deptno order by 
deptno;")
+        sql("select * from (select deptno, empid from emps where deptno>100) A 
join (select deptno, empid from emps where deptno >200) B using (deptno);")
         contains "(emps_mv)"
+        notContains "(emps)"
     }
-    qt_select_mv "select sum(salary), deptno from emps group by deptno order 
by deptno;"
-
+    qt_select_mv "select * from (select deptno, empid from emps where 
deptno>100) A join (select deptno, empid from emps where deptno >200) B using 
(deptno) order by 1;"
 
 }
\ No newline at end of file
diff --git 
a/regression-test/suites/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy 
b/regression-test/suites/mv_p0/ut/testUnionDistinct/testUnionDistinct.groovy
similarity index 79%
rename from 
regression-test/suites/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy
rename to 
regression-test/suites/mv_p0/ut/testUnionDistinct/testUnionDistinct.groovy
index 1f1802dd75..57f4e6c174 100644
--- 
a/regression-test/suites/mv_p0/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy
+++ b/regression-test/suites/mv_p0/ut/testUnionDistinct/testUnionDistinct.groovy
@@ -17,7 +17,7 @@
 
 import org.codehaus.groovy.runtime.IOGroovyMethods
 
-suite ("testAggQueryOnAggMV1") {
+suite ("testUnionDistinct") {
     sql """ DROP TABLE IF EXISTS emps; """
 
     sql """
@@ -35,8 +35,7 @@ suite ("testAggQueryOnAggMV1") {
     sql """insert into emps values("2020-01-02",2,"b",2,2,2);"""
     sql """insert into emps values("2020-01-03",3,"c",3,3,3);"""
 
-
-    createMV("create materialized view emps_mv as select deptno, sum(salary), 
max(commission) from emps group by deptno ;")
+    createMV("create materialized view emps_mv as select empid, deptno from 
emps order by empid, deptno;")
 
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
@@ -48,10 +47,10 @@ suite ("testAggQueryOnAggMV1") {
 
 
     explain {
-        sql("select sum(salary), deptno from emps group by deptno order by 
deptno;")
+        sql("select empid, deptno from emps where empid >1 union select empid, 
deptno from emps where empid <0 order by empid;")
         contains "(emps_mv)"
+        notContains "(emps)"
     }
-    qt_select_mv "select sum(salary), deptno from emps group by deptno order 
by deptno;"
-
+    qt_select_mv "select * from (select empid, deptno from emps where empid >1 
union select empid, deptno from emps where empid <0) t order by 1;"
 
 }
\ 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