Hi Leonard, Thank you for preparing this FLIP. I have a few questions.
1) A "Versioned Temporal Table DDL on source" can only be joined on the PRIMARY KEY attribute, correct? 2) The "processing time temporal table join" example under "how to correlate a temporal table" does not make sense to me. Isn't it the time attribute in the ORDER BY clause of the VIEW definition that defines whether a event-time or processing time temporal table join is used? Of course, the time characteristic of the lookup time attribute should match the time characteristics of the versioning attribute. 3) A "Versioned Temporal Table DDL on source" is always versioned on operation_time regardless of the lookup table attribute (event-time or processing time attribute), correct? Or does the lookup table attribute define the versioning? Thanks, Konstantin On Tue, Jul 28, 2020 at 9:56 AM Leonard Xu <xbjt...@gmail.com> wrote: > Hello everyone, > > Currently, user can correlate temporal table by temporal table join to > enrich their fact table, a temporal table can be a changing history table > which tracks the changes(e.g. database changelog) or a changing dimensioned > table which materializes the changes(e.g. database table). For changing > dimensioned table, Flink uses DDL to define a temporal table and visits the > temporal table data by looking up the external system’s table. For changing > history table, Flink uses temporal table function to define a parameterized > view of changing history table and then accesses the data of view, but > Temporal Table Function can only be called via Table API or YAML which is > pretty inconvenient for FLINK SQL users. If we can support temporal table > DDL, user no longer needs temporal table function, and they can visit > temporal table easily in pure SQL world. > > Flink SQL obtains the ability to interpret changelog after FLIP-95[1], > changelog is natural temporal table which contains all versioned data of > the the origin database table. Support temporal table on changelog would > help user visit specific version of the original database table, this will > enrich Flink temporal table join scenario much. > > The community have already had a related discussion thread[2] and reach > some consensus. Based on that, I prepare the FLIP-132[3] to support > Temporal Table DDL, please see the FLIP doc for more details. > > Any comment is welcome, I'm looking forward to your feedback. > > Best > Leonard > [1] > https://cwiki.apache.org/confluence/display/FLINK/FLIP-95%3A+New+TableSource+and+TableSink+interfaces > < > https://cwiki.apache.org/confluence/display/FLINK/FLIP-95:+New+TableSource+and+TableSink+interfaces > > > [2] > http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-FLINK-16824-Creating-Temporal-Table-Function-via-DDL-td40333.html > < > http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-FLINK-16824-Creating-Temporal-Table-Function-via-DDL-td40333.html > > > [3] > https://cwiki.apache.org/confluence/display/FLINK/FLIP-132+Temporal+Table+DDL > < > https://cwiki.apache.org/confluence/display/FLINK/FLIP-132+Temporal+Table+DDL > > -- Konstantin Knauf https://twitter.com/snntrable https://github.com/knaufk