KKcorps commented on a change in pull request #14257: URL: https://github.com/apache/flink/pull/14257#discussion_r535117943
########## File path: docs/dev/table/streaming/unbounded-data-processing/joins.md ########## @@ -129,37 +138,10 @@ AND r.rowtime = ( AND r2.rowtime <= o.rowtime); {% endhighlight %} -With the help of a temporal table function `Rates` over `RatesHistory`, we can express such a query in SQL as: - -{% highlight sql %} -SELECT - o.amount * r.rate AS amount -FROM - Orders AS o, - LATERAL TABLE (Rates(o.rowtime)) AS r -WHERE r.currency = o.currency -{% endhighlight %} - -Each record from the probe side will be joined with the version of the build side table at the time of the correlated time attribute of the probe side record. -In order to support updates (overwrites) of previous values on the build side table, the table must define a primary key. - -In our example, each record from `Orders` will be joined with the version of `Rates` at time `o.rowtime`. The `currency` field has been defined as the primary key of `Rates` before and is used to connect both tables in our example. If the query were using a processing-time notion, a newly appended order would always be joined with the most recent version of `Rates` when executing the operation. - -In contrast to [regular joins](#regular-joins), this means that if there is a new record on the build side, it will not affect the previous results of the join. -This again allows Flink to limit the number of elements that must be kept in the state. - -Compared to [interval joins](#interval-joins), temporal table joins do not define a time window within which bounds the records will be joined. -Records from the probe side are always joined with the build side's version at the time specified by the time attribute. Thus, records on the build side might be arbitrarily old. -As time passes, the previous and no longer needed versions of the record (for the given primary key) will be removed from the state. - -Such behaviour makes a temporal table join a good candidate to express stream enrichment in relational terms. - -### Usage - -After [defining temporal table function](temporal_tables.html#defining-temporal-table-function), we can start using it. -Temporal table functions can be used in the same way as normal table functions would be used. +To simplify such queries, Flink offers [Temporal Functions](../temporal_tables.html). For this example, we define a temporal function `Rates` as follows : + //TODO Review comment: My bad. Seems like IntelliJ settings got messed up. Removing them manually. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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