You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Leonard Xu (Jira)" <ji...@apache.org> on 2020/08/31 08:04:00 UTC

[jira] [Updated] (FLINK-19076) Import rule to deal Temporal Join condition

     [ https://issues.apache.org/jira/browse/FLINK-19076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonard Xu updated FLINK-19076:
-------------------------------
    Description: 
Temporal join is a correlate, the right of correlate is a *Snapshot*, the *period* of *snapshot* comes from left table's time attribute column. 

the time attribute column may be pruned if the downstream `RelNode` did not reference it any more, so I need to keep the necessary  condition(e.g., left time attribute, right primary key) for temporal join node in join condition.

Given an example:
{code:java}
SELECT o.order_id, o.currency, o.amount, r.rate,r.rowtime 
 FROM orders_proctime AS o JOIN 
 versioned_currency 
 FOR SYSTEM_TIME AS OF o.rowtime as r 
 ON o.currency = r.currency{code}
The select clause did not use `o.rowtime` and thus the column `o.rowtime` will be removed later, but we need the `o.rowtime` in temporal join node, so I keep the `o.rowtime` in temporal join condition just like[1].

[1] [https://github.com/apache/flink/blob/c601cfd662c2839f8ebc81b80879ecce55a8cbaf/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/TemporalJoinUtil.scala] 

 

> Import rule to deal Temporal Join condition
> -------------------------------------------
>
>                 Key: FLINK-19076
>                 URL: https://issues.apache.org/jira/browse/FLINK-19076
>             Project: Flink
>          Issue Type: Sub-task
>            Reporter: Leonard Xu
>            Priority: Major
>
> Temporal join is a correlate, the right of correlate is a *Snapshot*, the *period* of *snapshot* comes from left table's time attribute column. 
> the time attribute column may be pruned if the downstream `RelNode` did not reference it any more, so I need to keep the necessary  condition(e.g., left time attribute, right primary key) for temporal join node in join condition.
> Given an example:
> {code:java}
> SELECT o.order_id, o.currency, o.amount, r.rate,r.rowtime 
>  FROM orders_proctime AS o JOIN 
>  versioned_currency 
>  FOR SYSTEM_TIME AS OF o.rowtime as r 
>  ON o.currency = r.currency{code}
> The select clause did not use `o.rowtime` and thus the column `o.rowtime` will be removed later, but we need the `o.rowtime` in temporal join node, so I keep the `o.rowtime` in temporal join condition just like[1].
> [1] [https://github.com/apache/flink/blob/c601cfd662c2839f8ebc81b80879ecce55a8cbaf/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/TemporalJoinUtil.scala] 
>  



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