seawinde commented on code in PR #39265:
URL: https://github.com/apache/doris/pull/39265#discussion_r1719555326


##########
regression-test/suites/mv_p0/ut/testAggQueryOnAggMV1/testAggQueryOnAggMV1.groovy:
##########
@@ -44,84 +44,33 @@ suite ("testAggQueryOnAggMV1") {
     sql """insert into emps values("2020-01-01",1,"a",1,1,1);"""
 
     sql "analyze table emps with sync;"
-    sql """set enable_stats=false;"""
 
-    explain {
-        sql("select * from emps order by empid;")
-        contains "(emps)"
-    }
+    mv_rewrite_all_fail("select * from emps order by empid;")
     qt_select_star "select * from emps order by empid;"
 
 
-    explain {
-        sql("select sum(salary), deptno from emps group by deptno order by 
deptno;")
-        contains "(emps_mv)"
-    }
+    mv_rewrite_success("select sum(salary), deptno from emps group by deptno 
order by deptno;", "emps_mv")
+    
     qt_select_mv "select sum(salary), deptno from emps group by deptno order 
by deptno;"
 
-    explain {
-        sql("select sum(salary) as salary from emps;")
-        contains "(emps_mv)"
-    }
+    mv_rewrite_success("select sum(salary) as salary from emps;", "emps_mv")
+    
     qt_select_mv "select sum(salary) as salary from emps;"
 
-    explain {
-        sql("select deptno, count(deptno) from emps group by deptno order by 
deptno;")
-        contains "(emps_mv_count_key)"
-    }
+    mv_rewrite_success("select deptno, count(deptno) from emps group by deptno 
order by deptno;", "emps_mv_count_key")
+    
     qt_select_mv "select deptno, count(deptno) from emps group by deptno order 
by deptno;"
 
-    explain {
-        sql("select deptno, sum(if(empid = 1, empid, salary)) from emps group 
by deptno;")
-        contains "(emps_mv_if)"
-    }
+    mv_rewrite_success("select deptno, sum(if(empid = 1, empid, salary)) from 
emps group by deptno;", "emps_mv_if")
+    
     qt_select_mv "select deptno, sum(if(empid = 1, empid, salary)) from emps 
group by deptno order by deptno;"
 
-    explain {
-        sql("select deptno, count(deptno) from emps where deptno=1 group by 
deptno order by deptno;")
-        contains "(emps_mv_count_key)"
-    }
+    mv_rewrite_success("select deptno, count(deptno) from emps where deptno=1 
group by deptno order by deptno;", "emps_mv_count_key")
+    
     qt_select_mv "select deptno, count(deptno) from emps where deptno=1 group 
by deptno order by deptno;"
 
-    explain {
-        sql("select deptno, sum(salary), max(commission) from emps where 
salary=1 group by deptno order by deptno;")
-        contains "(emps)"
-    }
+    mv_rewrite_all_fail("select deptno, sum(salary), max(commission) from emps 
where salary=1 group by deptno order by deptno;")
+        
     qt_select_mv "select deptno, sum(salary), max(commission) from emps where 
salary=1 group by deptno order by deptno;"
 
-    sql """set enable_stats=true;"""
-    explain {
-        sql("select * from emps order by empid;")
-        contains "(emps)"
-    }
-
-    explain {
-        sql("select sum(salary), deptno from emps group by deptno order by 
deptno;")
-        contains "(emps_mv)"
-    }
-
-    explain {
-        sql("select sum(salary) as salary from emps;")
-        contains "(emps_mv)"
-    }
-

Review Comment:
   the same with above



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to