Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
Signed-off-by: before-Sunrise <[email protected]>
  • Loading branch information
before-Sunrise committed Sep 3, 2024
1 parent 75c0147 commit 01875f0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
" | <slot 2> : '2024-07-20'\n" +
" | <slot 3> : '2024-06-20 00:00:00'\n" +
" | <slot 4> : '2024-08-20 00:00:00'\n" +
" | <slot 6> : 11: k1\n" +
" | <slot 7> : 12: k2\n" +
" | <slot 8> : 13: k3\n" +
" | <slot 10> : 14: sum(v1)\n" +
" | <slot 10> : '2024-07-20'\n" +
" | <slot 11> : '2024-06-20 00:00:00'\n" +
" | <slot 12> : '2024-08-20 00:00:00'\n" +
" | <slot 13> : 14: sum(v1)\n" +
" | \n" +
" 0:OlapScanNode\n" +
" TABLE: mv1");
Expand All @@ -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" +
"| <slot 11> : col$: k1\n" +
"| <slot 14> : col$: sum(v1)\n" +
"| <slot 14> : col$: k1\n" +
"| <slot 17> : col$: sum(v1)\n" +
"|\n" +
"0:OlapScanNode\n" +
"TABLE: mv1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void testWithCrossJoin() throws Exception {
PlanTestBase.assertContains(plan, " 1:Project\n" +
" | <slot 1> : 1: L_ORDERKEY\n" +
" | <slot 2> : 2: L_PARTKEY\n" +
" | <slot 19> : '2000-01-01'\n" +
" | <slot 20> : '2000-01-01'\n" +
" | \n" +
" 0:OlapScanNode\n" +
" TABLE: lineitem_partition");
Expand All @@ -66,7 +66,7 @@ public void testWithCrossJoin() throws Exception {
" | <slot 15> : 15: L_SHIPMODE\n" +
" | <slot 16> : 16: L_COMMENT\n" +
" | <slot 17> : 17: PAD\n" +
" | <slot 19> : '2000-01-01'\n" +
" | <slot 20> : '2000-01-01'\n" +
" | \n" +
" 0:OlapScanNode\n" +
" TABLE: lineitem_partitio");
Expand All @@ -82,7 +82,7 @@ public void testWithInnerJoin() throws Exception {
PlanTestBase.assertContains(plan, " 1:Project\n" +
" | <slot 1> : 1: L_ORDERKEY\n" +
" | <slot 2> : 2: L_PARTKEY\n" +
" | <slot 19> : '2000-01-01'\n" +
" | <slot 20> : '2000-01-01'\n" +
" | \n" +
" 0:OlapScanNode\n" +
" TABLE: lineitem_partition");
Expand All @@ -96,12 +96,12 @@ public void testWithInnerJoin() throws Exception {
PlanTestBase.assertContains(plan, " 1:Project\n" +
" | <slot 1> : 1: L_ORDERKEY\n" +
" | <slot 2> : 2: L_PARTKEY\n" +
" | <slot 19> : '2000-01-01'\n" +
" | <slot 20> : '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
Expand All @@ -113,14 +113,13 @@ public void testWithInnerJoin() throws Exception {
PlanTestBase.assertContains(plan, " 1:Project\n" +
" | <slot 1> : 1: L_ORDERKEY\n" +
" | <slot 2> : 2: L_PARTKEY\n" +
" | <slot 19> : '2000-01-01'\n" +
" | <slot 20> : 'key1'\n" +
" | <slot 21> : '2000-01-01'\n" +
" | <slot 22> : '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'");
}
}

Expand Down Expand Up @@ -188,7 +187,7 @@ public void testWithRightOuterJoin1() throws Exception {
" | colocate: false, reason: \n" +
" | \n" +
" |----3:Project\n" +
" | | <slot 19> : '2000-01-01'\n" +
" | | <slot 22> : 1\n" +
" | | \n" +
" | 2:UNION\n" +
" | constant exprs: \n" +
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 01875f0

Please sign in to comment.