From 39d686a5b0a652197d57497e9e486b4585f27c6b Mon Sep 17 00:00:00 2001 From: "shuming.li" Date: Fri, 23 Aug 2024 21:19:52 +0800 Subject: [PATCH] fix bugs Signed-off-by: shuming.li --- .../planner/MaterializedViewManualTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fe/fe-core/src/test/java/com/starrocks/planner/MaterializedViewManualTest.java b/fe/fe-core/src/test/java/com/starrocks/planner/MaterializedViewManualTest.java index 73535c967ec830..a529af16f23b98 100644 --- a/fe/fe-core/src/test/java/com/starrocks/planner/MaterializedViewManualTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/planner/MaterializedViewManualTest.java @@ -477,18 +477,17 @@ public void testRewriteWithPushDownEquivalent4() throws Exception { "AS SELECT k1, k3, sum(k2) from tbl1 group by k1, k3"); // sum(decimal) { - setTracLogModule("MV"); String sql = "select t1.k1, " + " 2 * sum(case when t1.k1 between date_add('2024-07-20', interval -1 month) and " + " date_add('2024-07-20', interval 1 month) then t1.k2 else 0 end) " + " from tbl1 t1 group by t1.k1"; - String plan = getFragmentPlan(sql, "MV"); + String plan = getVerboseExplain(sql); PlanTestBase.assertContains(plan, "mv1"); - PlanTestBase.assertContains(plan, "| aggregate: sum[(if[((8: k1 >= '2024-06-20') AND " + + PlanTestBase.assertContains(plan, " | aggregate: sum[(if[((8: k1 >= '2024-06-20') AND " + "(8: k1 <= '2024-08-20'), [10: sum(k2), DECIMAL128(38,2), true], cast(0 as DECIMAL128(38,2))); " + "args: BOOLEAN,DECIMAL128,DECIMAL128; result: DECIMAL128(38,2); args nullable: true; " + - "result nullable: true]); args: DECIMAL128; result: DECIMAL128; args nullable: true; " + - "result nullable: true]"); + "result nullable: true]); args: DECIMAL128; result: DECIMAL128(38,2); " + + "args nullable: true; result nullable: true]"); } { String sql = "select t1.k1, " + @@ -530,9 +529,10 @@ public void testRewriteWithPushDownEquivalent5() throws Exception { " from tbl1 t1 group by t1.k1"; String plan = getVerboseExplain(sql); PlanTestBase.assertContains(plan, "mv1"); - PlanTestBase.assertContains(plan, "aggregate: sum[(CASE WHEN (8: k1 >= '2024-06-20') " + - "AND (8: k1 <= '2024-08-20') THEN 10: sum(k2) WHEN 9: k3 = 'xxxx' THEN 10: sum(k2) ELSE 0 END); " + - "args: DECIMAL128; result: DECIMAL128; args nullable: true; result nullable: true]"); + PlanTestBase.assertContains(plan, "| aggregate: sum[(CASE WHEN (8: k1 >= '2024-06-20') AND " + + "(8: k1 <= '2024-08-20') THEN 10: sum(k2) WHEN 9: k3 = 'xxxx' THEN 10: sum(k2) " + + "ELSE CAST(0 AS DECIMAL128(38,2)) END); args: DECIMAL128; result: DECIMAL128(38,2); " + + "args nullable: true; result nullable: true]"); } {