XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Resolved
    • None
    • None
    • Table SQL / Planner
    • None

    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:

      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

      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 

       

      Attachments

        Activity

          People

            leonard Leonard Xu
            leonard Leonard Xu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: