[ 
https://issues.apache.org/jira/browse/FLINK-23723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17406509#comment-17406509
 ] 

Ada Wong commented on FLINK-23723:
----------------------------------

cc [~jark] We should decouple lookup join from the source table proc time field.

> Look up join support PROCTIME() function
> ----------------------------------------
>
>                 Key: FLINK-23723
>                 URL: https://issues.apache.org/jira/browse/FLINK-23723
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>            Reporter: silence
>            Priority: Major
>
> Now,when we what to use look up join we must declare procetime attribute on 
> source table.
> this is relatively troublesome, and in some complex scenarios(eg. Top-N) , 
> look up join cannot be performed because of the loss of processtime attribute.
> Moreover, in the process of look up join, the processing time is of no 
> practical use. can we support specifying `PROCTIME()` directly in the join 
> without declaring it in the source table,
> like:
> {code:sql}
> SELECT o.order_id, o.total, c.country, c.zip
> FROM Orders AS o
>   JOIN Customers FOR SYSTEM_TIME AS OF PROCTIME() AS c
>     ON o.customer_id = c.id;
> {code}
> Now it throws an exception
> {code:java}
> Caused by: java.lang.AssertionError: Temporal table can only be used in 
> temporal join and only supports 'FOR SYSTEM_TIME AS OF' left table's time 
> attribute field.
> Querying a temporal table using 'FOR SYSTEM TIME AS OF' syntax with an 
> expression call 'PROCTIME()' is not supported yet.
> at org.apache.calcite.util.Litmus$1.fail(Litmus.java:31)
> at 
> org.apache.flink.table.planner.plan.nodes.logical.FlinkLogicalSnapshot.isValid(FlinkLogicalSnapshot.scala:60)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to