snuyanzin commented on code in PR #79: URL: https://github.com/apache/flink-connector-jdbc/pull/79#discussion_r1463067787
########## flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcTablePlanTest.java: ########## @@ -70,6 +98,51 @@ public void testFilterPushdown() { "SELECT id, time_col, real_col FROM jdbc WHERE id = 900001 AND time_col <> TIME '11:11:11' OR double_col >= -1000.23"); } + /** + * Note the join condition is not present in the optimized plan, as it is handled in the JDBC + * java code, where it adds the join conditions to the select statement string. + */ + @Test + public void testLookupJoin() { + util.verifyExecPlan( + "SELECT * FROM a LEFT JOIN d FOR SYSTEM_TIME AS OF a.proctime ON a.ip = d.ip"); + } + + @Test + public void testLookupJoinWithFilter() { + util.verifyExecPlan( + "SELECT * FROM a LEFT JOIN d FOR SYSTEM_TIME AS OF a.proctime ON d.type = 0 AND a.ip = d.ip"); + } + + @Test + public void testLookupJoinWithANDAndORFilter() { + util.verifyExecPlan( + "SELECT * FROM a LEFT JOIN d FOR SYSTEM_TIME AS OF a.proctime ON ((d.age = 50 AND d.type = 0) " + + "OR (d.type = 1 AND d.age = 40)) AND a.ip = d.ip"); + } + + @Test + public void testLookupJoinWith2ANDsAndORFilter() { + util.verifyExecPlan( + "SELECT * FROM a JOIN d FOR SYSTEM_TIME AS OF a.proctime " + + "ON ((50 > d.age AND d.type = 1 AND d.age > 0 ) " + + "OR (70 > d.age AND d.type = 6 AND d.age > 10)) AND a.ip = d.ip"); + } + + @Test + public void testLookupJoinWithORFilter() { + util.verifyExecPlan( + "SELECT * FROM a LEFT JOIN d FOR SYSTEM_TIME AS OF a.proctime ON (d.age = 50 OR d.type = 1) AND a.ip = d.ip"); + } + + @Test + public void testLookupJoinWithWeirdColumnNames() { Review Comment: ```suggestion void testLookupJoinWithWeirdColumnNames() { ``` -- 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