lincoln-lil commented on code in PR #21545:
URL: https://github.com/apache/flink/pull/21545#discussion_r1115683129
##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/join/LookupJoinTest.scala:
##########
@@ -951,6 +953,39 @@ class LookupJoinTest(legacyTableSource: Boolean) extends
TableTestBase with Seri
util.verifyExplain(stmt, ExplainDetail.JSON_EXECUTION_PLAN)
}
+ @Test
+ def testJoinWithLookupJoinHint(): Unit = {
+ val sql = "SELECT /*+ LOOKUP('table'='D', 'retry-predicate'='lookup_miss',
" +
+ "'retry-strategy'='fixed_delay', 'fixed-delay'='155 ms',
'max-attempts'='10', " +
+ "'async'='true', 'output-mode'='allow_unordered','capacity'='1000',
'time-out'='300 s') */ " +
+ "T.a FROM MyTable AS T JOIN LookupTable FOR SYSTEM_TIME AS OF T.proctime
AS D ON T.a = D.id"
+
+ util.verifyExecPlan(sql)
+ }
+
+ @Test
+ def testJoinInvalidUDTFWithLookupJoinHint(): Unit = {
Review Comment:
we should move this case into CorrelateTest or JoinTest since uses lateral
table.
##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/join/LookupJoinTest.scala:
##########
@@ -951,6 +953,39 @@ class LookupJoinTest(legacyTableSource: Boolean) extends
TableTestBase with Seri
util.verifyExplain(stmt, ExplainDetail.JSON_EXECUTION_PLAN)
}
+ @Test
+ def testJoinWithLookupJoinHint(): Unit = {
+ val sql = "SELECT /*+ LOOKUP('table'='D', 'retry-predicate'='lookup_miss',
" +
+ "'retry-strategy'='fixed_delay', 'fixed-delay'='155 ms',
'max-attempts'='10', " +
+ "'async'='true', 'output-mode'='allow_unordered','capacity'='1000',
'time-out'='300 s') */ " +
+ "T.a FROM MyTable AS T JOIN LookupTable FOR SYSTEM_TIME AS OF T.proctime
AS D ON T.a = D.id"
+
+ util.verifyExecPlan(sql)
+ }
+
+ @Test
+ def testJoinInvalidUDTFWithLookupJoinHint(): Unit = {
+ // not support to extract table name from udtf now
+ expectExceptionThrown(
+ "SELECT /*+ LOOKUP('table'='D', 'retry-predicate'='lookup_miss', " +
+ "'retry-strategy'='fixed_delay', 'fixed-delay'='155 ms',
'max-attempts'='10', " +
+ "'async'='true', 'output-mode'='allow_unordered','capacity'='1000',
'time-out'='300 s') */ " +
+ "T.a FROM MyTable AS T CROSS JOIN LATERAL TABLE(MockUDTF(a)) AS D(b)",
+ "The options of following hints cannot match the name of input tables or
views: \n" +
+ "`D` in `LOOKUP`"
+ )
+ }
+
+ @Test
+ def testJoinUnnestWithLookupJoinHint(): Unit = {
Review Comment:
This should be moved into UnnestTest
--
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]