davidradl commented on code in PR #79:
URL: 
https://github.com/apache/flink-connector-jdbc/pull/79#discussion_r1411857176


##########
flink-connector-jdbc/src/test/resources/org/apache/flink/connector/jdbc/table/JdbcTablePlanTest.xml:
##########
@@ -68,4 +68,29 @@ TableSourceScan(table=[[default_catalog, default_database, 
jdbc, filter=[and(OR(
 ]]>
        </Resource>
   </TestCase>
+    <TestCase name="testLookupJoin">
+        <Resource name="sql">
+            <![CDATA[SELECT * FROM a left join c FOR SYSTEM_TIME AS OF 
a.proctime on c.type = 0 and a.ip = c.ip]]>
+        </Resource>
+        <Resource name="ast">
+            <![CDATA[
+LogicalProject(ip=[$0], proctime=[$1], ip0=[$2], type=[$3], age=[$4])
++- LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{0, 
1}])
+   :- LogicalProject(ip=[$0], proctime=[PROCTIME()])
+   :  +- LogicalTableScan(table=[[default_catalog, default_database, a]])
+   +- LogicalFilter(condition=[AND(=($1, 0), =($cor0.ip, 
CAST($0):VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))])
+      +- LogicalSnapshot(period=[$cor0.proctime])
+         +- LogicalTableScan(table=[[default_catalog, default_database, c]])
+]]>
+        </Resource>
+        <Resource name="optimized exec plan">
+            <![CDATA[
+Calc(select=[ip, PROCTIME_MATERIALIZE(proctime) AS proctime, ip0, type, age])
++- LookupJoin(table=[default_catalog.default_database.c], 
joinType=[LeftOuterJoin], lookup=[ip=ip], select=[ip, proctime, ip, CAST(0 AS 
INTEGER) AS type, age, CAST(ip AS VARCHAR(2147483647)) AS ip0])

Review Comment:
   > I might be missing something, as I dont see `c.type = 0` in the physical 
plan, I am not expert here though, wonder if anyone has a clue?
   
   Yes, this is intended; see the 
[conversation](https://github.com/apache/flink-connector-jdbc/pull/79#issuecomment-1818476193)
 with with @snuyanzin. I added this test on his request, though we know it does 
not have the filter. 



-- 
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