tsreaper commented on a change in pull request #17845:
URL: https://github.com/apache/flink/pull/17845#discussion_r754754304



##########
File path: 
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/join/LookupJoinTest.scala
##########
@@ -525,7 +525,21 @@ class LookupJoinTest(legacyTableSource: Boolean) extends 
TableTestBase with Seri
     verifyTranslationSuccess(sql)
   }
 
-  // 
==========================================================================================
+  @Test
+  def testJoinTemporalTableWithCTE(): Unit = {
+    val sql =
+      """
+        |WITH MyLookupTable AS (SELECT * FROM MyTable),
+        |OtherLookupTable AS (SELECT * FROM LookupTable)
+        |SELECT MyLookupTable.b FROM MyLookupTable
+        |JOIN OtherLookupTable FOR SYSTEM_TIME AS OF MyLookupTable.proctime AS 
D
+        |ON MyLookupTable.a = D.id AND D.age = 10
+      """.stripMargin
+
+    verifyTranslationSuccess(sql)

Review comment:
       I would recommend `util.verifyExecPlan` so that we can compare the exact 
plan in the future.
   
   Note that to use this checking method, you'll have to first remove the 
corresponding LookupJoinTest.xml file of this test then run the whole test 
class. You'll find that a new LookupJoinTest.xml is generated and then git will 
show you what is added to the new LookupJoinTest.xml. Make sure that the added 
plan meets your expectation.




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