[ https://issues.apache.org/jira/browse/FLINK-10626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681512#comment-16681512 ]
ASF GitHub Bot commented on FLINK-10626: ---------------------------------------- pnowojski commented on a change in pull request #7065: [FLINK-10626] [docs] [table] Add documentation for event-time temporal table joins URL: https://github.com/apache/flink/pull/7065#discussion_r232268772 ########## File path: docs/dev/table/streaming/joins.md ########## @@ -189,14 +189,26 @@ val result = orders </div> </div> +**Note**: State retention defined in a [query configuration](query_configuration.html) is not yet considered for temporal joins. This means that the required state to compute the query result might grow infinitely depending on the number of distinct primary keys for the history table. + ### Processing-time Temporal Joins With a processing-time time attribute, it is impossible to pass _past_ time attributes as an argument to the temporal table function. -By definition, it is always the current timestamp. Thus, processing-time temporal table function invocations will always return the latest known versions of the underlying table +By definition, it is always the current timestamp. Thus, invocations of a processing-time temporal table function will always return the latest known versions of the underlying table and any updates in the underlying history table will also immediately overwrite the current values. Only the latest versions (with respect to the defined primary key) of the build side records are kept in the state. New updates will have no effect on the previously results emitted/processed records from the probe side. -One can think about processing-time temporal join as a simple `HashMap<K, V>` that stores all of the records from the build side. +One can think about a processing-time temporal join as a simple `HashMap<K, V>` that stores all of the records from the build side. When a new record from the build side has the same key as some previous record, the old value is just simply overwritten. Every record from the probe side is always evaluated against the most recent/current state of the `HashMap`. + +### Event-time Temporal Joins + +With an event-time time attribute (i.e., a rowtime attribute), it is possible to pass _past_ time attributes to the temporal table function. This allows for joining the two tables at a common point in time. + +Compared to processing-time temporal joins, the temporal table does not only keep the latest version (with respect to the defined primary key) of the build side records in the state but stores multiple versions of them identified by time. + +For example, an incoming row with an event-time timestamp of `12:30:00` that is appened to the probe side table is joined with the version of the build side table at time `12:30:00` according to the [concept of temporal tables](temporal_tables.html). Thus, the incoming row is only joined with rows that have a timestamp lower or equal to `12:30:00` with applied updates according to the primary key until this point in time. Review comment: `that is appened` -> `that is appended` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > Add documentation for event-time temporal table joins > ----------------------------------------------------- > > Key: FLINK-10626 > URL: https://issues.apache.org/jira/browse/FLINK-10626 > Project: Flink > Issue Type: Sub-task > Components: Documentation, Table API & SQL > Affects Versions: 1.7.0 > Reporter: Till Rohrmann > Assignee: Timo Walther > Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > The Flink documentation should be updated to cover the newly added > functionality. -- This message was sent by Atlassian JIRA (v7.6.3#76005)