AlanConfluent commented on code in PR #24992:
URL: https://github.com/apache/flink/pull/24992#discussion_r1716097851


##########
flink-table/flink-table-planner/src/test/resources/org/apache/flink/table/planner/plan/rules/logical/AsyncCalcSplitRuleTest.xml:
##########
@@ -550,6 +550,33 @@ AsyncCalc(select=[func1(a) AS EXPR$0])
    +- Exchange(distribution=[single])
       +- Calc(select=[a2])
          +- TableSourceScan(table=[[default_catalog, default_database, 
MyTable2]], fields=[a2, b2, c2, d2])
+]]>
+               </Resource>
+       </TestCase>
+       <TestCase name="testRightJoinWithFuncInWhereUsingBothTables">
+               <Resource name="sql">
+                       <![CDATA[SELECT a from MyTable RIGHT JOIN MyTable2 ON a 
= a2 WHERE a = a2 AND func6(a, a2) > 10]]>
+               </Resource>
+               <Resource name="ast">
+                       <![CDATA[
+LogicalProject(a=[$0])
++- LogicalFilter(condition=[AND(=($0, $4), >(func6($0, $4), 10))])
+   +- LogicalJoin(condition=[=($0, $4)], joinType=[right])
+      :- LogicalTableScan(table=[[default_catalog, default_database, MyTable]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, 
MyTable2]])
+]]>
+               </Resource>
+               <Resource name="optimized rel plan">
+                       <![CDATA[
+Calc(select=[a], where=[>(f0, 10)])
++- AsyncCalc(select=[a, a2, func6(a, a2) AS f0])
+   +- Join(joinType=[InnerJoin], where=[=(a, a2)], select=[a, a2], 
leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])

Review Comment:
   This particular example actually becomes an inner join mainly due to the 
fact that it has the additional clause `WHERE a = a2` in addition to `ON`.  I 
added a case where it is missing the WHERE portion 
`testRightJoinWithFuncInWhereUsingBothTables`.  In this case, it is pulled out 
above the join automatically (due to an existing rule).



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to