From 01875f02020e17796e771f95754dc0cdda1f27b4 Mon Sep 17 00:00:00 2001 From: before-Sunrise Date: Mon, 26 Aug 2024 13:03:29 +0800 Subject: [PATCH] fix test case Signed-off-by: before-Sunrise --- .../planner/MaterializedViewManualTest.java | 12 ++++----- .../sql/plan/EliminateConstantValueTest.java | 25 +++++++++---------- 2 files changed, 18 insertions(+), 19 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 c28479f2a3926..6de7a9d7a15ce 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 @@ -488,13 +488,13 @@ public void testRewriteWithEliminateJoinsBasic2() throws Exception { " group by cte.date1, cte.start_date, cte.end_date, t1.k1, t1.k2, t1.k3"; sql(sql).contains("mv1") .contains(" 1:Project\n" + - " | : '2024-07-20'\n" + - " | : '2024-06-20 00:00:00'\n" + - " | : '2024-08-20 00:00:00'\n" + " | : 11: k1\n" + " | : 12: k2\n" + " | : 13: k3\n" + - " | : 14: sum(v1)\n" + + " | : '2024-07-20'\n" + + " | : '2024-06-20 00:00:00'\n" + + " | : '2024-08-20 00:00:00'\n" + + " | : 14: sum(v1)\n" + " | \n" + " 0:OlapScanNode\n" + " TABLE: mv1"); @@ -514,8 +514,8 @@ public void testRewriteWithEliminateJoinsBasic2() throws Exception { " group by cte.date1, cte.start_date, cte.end_date, t1.k1"; sql(sql).contains("mv1") .contains("1:Project\n" + - "| : col$: k1\n" + - "| : col$: sum(v1)\n" + + "| : col$: k1\n" + + "| : col$: sum(v1)\n" + "|\n" + "0:OlapScanNode\n" + "TABLE: mv1"); diff --git a/fe/fe-core/src/test/java/com/starrocks/sql/plan/EliminateConstantValueTest.java b/fe/fe-core/src/test/java/com/starrocks/sql/plan/EliminateConstantValueTest.java index 25ac17ce4f0f8..44fdebe24923a 100644 --- a/fe/fe-core/src/test/java/com/starrocks/sql/plan/EliminateConstantValueTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/sql/plan/EliminateConstantValueTest.java @@ -40,7 +40,7 @@ public void testWithCrossJoin() throws Exception { PlanTestBase.assertContains(plan, " 1:Project\n" + " | : 1: L_ORDERKEY\n" + " | : 2: L_PARTKEY\n" + - " | : '2000-01-01'\n" + + " | : '2000-01-01'\n" + " | \n" + " 0:OlapScanNode\n" + " TABLE: lineitem_partition"); @@ -66,7 +66,7 @@ public void testWithCrossJoin() throws Exception { " | : 15: L_SHIPMODE\n" + " | : 16: L_COMMENT\n" + " | : 17: PAD\n" + - " | : '2000-01-01'\n" + + " | : '2000-01-01'\n" + " | \n" + " 0:OlapScanNode\n" + " TABLE: lineitem_partitio"); @@ -82,7 +82,7 @@ public void testWithInnerJoin() throws Exception { PlanTestBase.assertContains(plan, " 1:Project\n" + " | : 1: L_ORDERKEY\n" + " | : 2: L_PARTKEY\n" + - " | : '2000-01-01'\n" + + " | : '2000-01-01'\n" + " | \n" + " 0:OlapScanNode\n" + " TABLE: lineitem_partition"); @@ -96,12 +96,12 @@ public void testWithInnerJoin() throws Exception { PlanTestBase.assertContains(plan, " 1:Project\n" + " | : 1: L_ORDERKEY\n" + " | : 2: L_PARTKEY\n" + - " | : '2000-01-01'\n" + + " | : '2000-01-01'\n" + " | \n" + " 0:OlapScanNode\n" + " TABLE: lineitem_partition\n" + " PREAGGREGATION: ON\n" + - " PREDICATES: 11: L_SHIPDATE = '2000-01-01', CAST(11: L_SHIPDATE AS DATETIME) IS NOT NULL"); + " PREDICATES: 11: L_SHIPDATE = '2000-01-01'"); } // join on multi columns @@ -113,14 +113,13 @@ public void testWithInnerJoin() throws Exception { PlanTestBase.assertContains(plan, " 1:Project\n" + " | : 1: L_ORDERKEY\n" + " | : 2: L_PARTKEY\n" + - " | : '2000-01-01'\n" + - " | : 'key1'\n" + + " | : '2000-01-01'\n" + + " | : 'key1'\n" + " | \n" + " 0:OlapScanNode\n" + " TABLE: lineitem_partition\n" + " PREAGGREGATION: ON\n" + - " PREDICATES: 11: L_SHIPDATE = '2000-01-01', CAST(2: L_PARTKEY AS VARCHAR(1048576)) = 'key1', " + - "CAST(11: L_SHIPDATE AS DATETIME) IS NOT NULL, CAST(2: L_PARTKEY AS VARCHAR(1048576)) IS NOT NULL"); + " PREDICATES: 11: L_SHIPDATE = '2000-01-01', CAST(2: L_PARTKEY AS VARCHAR(1048576)) = 'key1'"); } } @@ -188,7 +187,7 @@ public void testWithRightOuterJoin1() throws Exception { " | colocate: false, reason: \n" + " | \n" + " |----3:Project\n" + - " | | : '2000-01-01'\n" + + " | | : 1\n" + " | | \n" + " | 2:UNION\n" + " | constant exprs: \n" + @@ -232,10 +231,10 @@ public void testWithLeftSemiJoin() throws Exception { String sql = "select * " + "from (select '2000-01-01' as col) t2 left semi join lineitem_partition t1 on t1.L_SHIPDATE = t2.col"; String plan = getFragmentPlan(sql); - PlanTestBase.assertContains(plan, " 5:HASH JOIN\n" + - " | join op: LEFT SEMI JOIN (BROADCAST)\n" + + PlanTestBase.assertContains(plan, "4:NESTLOOP JOIN\n" + + " | join op: LEFT SEMI JOIN\n" + " | colocate: false, reason: \n" + - " | equal join conjunct: 21: cast = 20: cast"); + " | other join predicates: 13: L_SHIPDATE = '2000-01-01'"); } @Test