snuyanzin commented on code in PR #29723:
URL: https://github.com/apache/flink/pull/29723#discussion_r4436438037


##########
flink-table/flink-table-planner/src/test/resources/org/apache/flink/table/planner/plan/stream/sql/join/JoinReorderTest.xml:
##########
@@ -728,6 +728,76 @@ Calc(select=[a6, b6, a7, b7, a8, b8])
    :        +- LegacyTableSourceScan(table=[[default_catalog, 
default_database, T8, source: [TestTableSource(a8, b8)]]], fields=[a8, b8])
    +- Exchange(distribution=[hash[b7]])
       +- LegacyTableSourceScan(table=[[default_catalog, default_database, T7, 
source: [TestTableSource(a7, b7)]]], fields=[a7, b7])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase 
name="testFilterOnNullGeneratingSideOfLeftOuterJoin[isBushyJoinReorder=false]">
+    <Resource name="sql">
+      <![CDATA[
+SELECT * FROM T1 LEFT JOIN
+   (SELECT * FROM T2 LEFT JOIN T3 ON a2 = a3 WHERE COALESCE(b3, b2) > 3) tab1
+   ON a1 = a2
+         ]]>
+    </Resource>
+    <Resource name="ast">
+      <![CDATA[
+LogicalProject(a1=[$0], b1=[$1], c1=[$2], a2=[$3], b2=[$4], c2=[$5], a3=[$6], 
b3=[$7], c3=[$8])
++- LogicalJoin(condition=[=($0, $3)], joinType=[left])
+   :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: 
[TestTableSource(a1, b1, c1)]]])
+   +- LogicalProject(a2=[$0], b2=[$1], c2=[$2], a3=[$3], b3=[$4], c3=[$5])
+      +- LogicalFilter(condition=[>(COALESCE($4, $1), 3)])
+         +- LogicalJoin(condition=[=($0, $3)], joinType=[left])
+            :- LogicalTableScan(table=[[default_catalog, default_database, T2, 
source: [TestTableSource(a2, b2, c2)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, T3, 
source: [TestTableSource(a3, b3, c3)]]])
+]]>
+    </Resource>
+    <Resource name="optimized rel plan">
+      <![CDATA[
+Join(joinType=[LeftOuterJoin], where=[=(a1, a2)], select=[a1, b1, c1, a2, b2, 
c2, a3, b3, c3], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
+:- Exchange(distribution=[hash[a1]])
+:  +- LegacyTableSourceScan(table=[[default_catalog, default_database, T1, 
source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
++- Exchange(distribution=[hash[a2]])
+   +- Calc(select=[a2, b2, c2, a3, b3, c3], where=[>(COALESCE(b3, b2), 3)])
+      +- Join(joinType=[LeftOuterJoin], where=[=(a2, a3)], select=[a2, b2, c2, 
a3, b3, c3], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
+         :- Exchange(distribution=[hash[a2]])
+         :  +- LegacyTableSourceScan(table=[[default_catalog, 
default_database, T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, 
c2])
+         +- Exchange(distribution=[hash[a3]])
+            +- LegacyTableSourceScan(table=[[default_catalog, 
default_database, T3, source: [TestTableSource(a3, b3, c3)]]], fields=[a3, b3, 
c3])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase 
name="testFilterOnNullGeneratingSideOfLeftOuterJoin[isBushyJoinReorder=true]">

Review Comment:
   why do we need bushy/non bushy if plans are same?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to