dawidwys commented on a change in pull request #10763: [FLINK-14200][table] Fix NPE for Temporal Table Function Join when left side is a query instead of a source URL: https://github.com/apache/flink/pull/10763#discussion_r363214928
########## File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/TemporalJoinITCase.scala ########## @@ -158,11 +160,87 @@ class TemporalJoinITCase(state: StateBackendMode) assertEquals(expectedOutput, sink.getAppendResults.toSet) } + + @Test + def testNestedTemporalJoin(): Unit = { + val env = StreamExecutionEnvironment.getExecutionEnvironment + val tEnv = StreamTableEnvironment.create(env, TableTestUtil.STREAM_SETTING) + env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime) + + val sqlQuery = + """ + |SELECT + | o.amount, r.rate, p.price Review comment: If we are using a real world example, could we make it more useful? How about: ``` Orders |- orderId: String |- productId: String |- amount: Long |- timestamp: Timestamp Rates |- currency: String |- rate: Double |- timestamp: Timestamp Prices |- productId: String |- currency: String |- price: Double |- timestamp: Timestamp Query: SELECT o.orderId, (o.amount * p.price * r.rate) as total_price FROM Orders AS o, LATERAL TABLE (Rates(o.rowtime)) AS r, LATERAL TABLE (Prices(o.rowtime)) AS p WHERE o.productId = p.productId AND r.currency = p.currency ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services