You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/11/20 12:19:33 UTC

[GitHub] [flink] leonardBang opened a new pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

leonardBang opened a new pull request #14152:
URL: https://github.com/apache/flink/pull/14152


   ## What is the purpose of the change
   
   * This pull request add docs for temporal table and temporal table join
   
   
   ## Brief change log
   
     - Update `table/streaming/temporal_table` page.
     - Update temporal join section in `table/streaming/joins` page.
     - Update `table/sql/queries` page.
     - Translate above pages to Chinese.
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): ( no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on a change in pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
leonardBang commented on a change in pull request #14152:
URL: https://github.com/apache/flink/pull/14152#discussion_r531342302



##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,174 +65,147 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
-Join with a Temporal Table Function
---------------------------
-
-A join with a temporal table function joins an append-only table (left input/probe side) with a temporal table (right input/build side),
-i.e., a table that changes over time and tracks its changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This feature is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention it is only supported in SQL, and not supported in Table API yet.

Review comment:
       I agree your point, @morsapaes . Old temporal joins(using temporal table function + `lateral`) is still supported in Table API, the newborn temporal join(using temporal table DDL + temporal join syntax) is supported in SQL.
   How about :
   ```
   Temporal table has two ways to define in Flink, i.e. [temporal table function]({% link dev/table/streaming/temporal_tables.md %}#temporal-table-function) ) and [temporal table DDL](({% link dev/table/streaming/temporal_tables.md %}#temporal-table-ddl)).
   Temporal join that using temporal table function is only supported in Table API,  temporal join that using temporal table DDL is only supported in SQL, please see the page [temporal table]({% link dev/table/streaming/temporal_tables.md %}) for more information about the differences between temporal table function and temporal table DDL.
   ```
    




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
leonardBang commented on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-733534487


   Hi, @dawidwys @sjwiesman I've rebase and fix the conflicts, appreciate if you have a more look.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] dawidwys commented on a change in pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
dawidwys commented on a change in pull request #14152:
URL: https://github.com/apache/flink/pull/14152#discussion_r528911851



##########
File path: docs/dev/table/streaming/temporal_tables.md
##########
@@ -20,103 +20,255 @@ software distributed under the License is distributed on an
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
--->
+--> 
 
-Temporal Tables represent a concept of a (parameterized) view on a changing table that returns the content of a table at a specific point in time.
+Temporal table is a table that evolves over time as known as Flink [dynamic table](dynamic_tables.html), rows in temporal table are associated with one or more temporal periods, all Flink tables are temporal(dynamic) table.
 
-The changing table can either be a changing history table which tracks the changes (e.g. database changelogs) or a changing dimension table which materializes the changes (e.g. database tables).
+A temporal table contains one or more versioned table snapshots, it can be a changing history table which tracks the changes(e.g. database changelog, contains all snapshots) or a changing dimensioned table which materializes the changes(e.g. database table, contains the latest snapshot). 
 
-For the changing history table, Flink can keep track of the changes and allows for accessing the content of the table at a certain point in time within a query. In Flink, this kind of table is represented by a *Temporal Table Function*.
+**Version**: A temporal table can split into a set of versioned table snapshots, the version in table snapshots represents the valid life circle of rows, the start time and the end time of the valid period can be assigned by users. 
+Temporal table can split to `versioned table` and `regular table` according to the table can tracks its history version or not.
 
-For the changing dimension table, Flink allows for accessing the content of the table at processing time within a query. In Flink, this kind of table is represented by a *Temporal Table*.
+**Versioned table**: If the row in temporal table can track its history changes and visit its history versions, we call this kind of temporal table as versioned table, the table comes from database changelog can define as a versioned table.
+
+**Regular table**: If the row in temporal table can only track and visit its latest version,we call this kind of temporal table as regular table. The table comes from database or HBase can define as a regular table.
 
 * This will be replaced by the TOC
 {:toc}
 
 Motivation
 ----------
 
-### Correlate with a changing history table
+### Correlate with a versioned table
+Given a scenario the order stream correlates the dimension table product, the table `orders` comes from kafka which contains the real time orders, the table `product_changelog` comes from the changelog of the database table `products`,
+ the product price in table `products` is changing over time. 
 
-Let's assume that we have the following table `RatesHistory`.
+{% highlight sql %}
+SELECT * FROM product_changelog;
+
+(changelog kind)  update_time  product_id product_name price
+================= ===========  ========== ============ ===== 
++(INSERT)         00:01:00     p_001      scooter      11.11
++(INSERT)         00:02:00     p_002      basketball   23.11
+-(UPDATE_BEFORE)  12:00:00     p_001      scooter      11.11
++(UPDATE_AFTER)   12:00:00     p_001      scooter      12.99
+-(UPDATE_BEFORE)  12:00:00     p_002      basketball   23.11 
++(UPDATE_AFTER)   12:00:00     p_002      basketball   19.99
+-(DELETE)         18:00:00     p_001      scooter      12.99 
+{% endhighlight %}
 
+The table `product_changelog` represents an ever growing changelog of database table `products`,  for example, the initial price of product `scooter` is `11.11` at `00:01:00`, and the price increases to `12.99` at `12:00:00`,
+ the product item is deleted from the table `products` at `18:00:00`.
+
+Given that we would like to output the version of `product_changelog` table of the time `10:00:00`, the following table shows the result. 
 {% highlight sql %}
-SELECT * FROM RatesHistory;
+update_time  product_id product_name price
+===========  ========== ============ ===== 
+00:01:00     p_001      scooter      11.11
+00:02:00     p_002      basketball   23.11
+{% endhighlight %}
 
-rowtime currency   rate
-======= ======== ======
-09:00   US Dollar   102
-09:00   Euro        114
-09:00   Yen           1
-10:45   Euro        116
-11:15   Euro        119
-11:49   Pounds      108
+Given that we would like to output the version of `product_changelog` table of the time `13:00:00`, the following table shows the result. 
+{% highlight sql %}
+update_time  product_id product_name price
+===========  ========== ============ ===== 
+12:00:00     p_001      scooter      12.99
+12:00:00     p_002      basketball   19.99
 {% endhighlight %}
 
-`RatesHistory` represents an ever growing append-only table of currency exchange rates with respect to `Yen` (which has a rate of `1`).
-For example, the exchange rate for the period from `09:00` to `10:45` of `Euro` to `Yen` was `114`. From `10:45` to `11:15` it was `116`.
+In above example, the specific version of the table is tracked by `update_time` and `product_id`,  the `product_id` would be a primary key for `product_changelog` table and `update_time` would be the event time.
+
+In Flink, this is represented by a [*versioned table*](#defining-versioned-table).
+
+### Correlate with a regular table
 
-Given that we would like to output all current rates at the time `10:58`, we would need the following SQL query to compute a result table:
+On the other hand, some use cases require to join a regular table which is an external database table.
 
+Let's assume that `LatestRates` is a table (e.g. stored in HBase) which is materialized with the latest rates. The `LatestRates` always represents the latest content of hbase table `rates`.
+ 
+Then the content of `LatestRates` table when we query at time `10:15:00` is:
 {% highlight sql %}
-SELECT *
-FROM RatesHistory AS r
-WHERE r.rowtime = (
-  SELECT MAX(rowtime)
-  FROM RatesHistory AS r2
-  WHERE r2.currency = r.currency
-  AND r2.rowtime <= TIME '10:58');
+10:15:00 > SELECT * FROM LatestRates;
+
+currency  rate
+========= ====
+US Dollar 102
+Euro      114
+Yen       1
+{% endhighlight %}
+
+Then the content of `LatestRates` table when we query at time `11:00:00` is:
+{% highlight sql %}
+11:00:00 > SELECT * FROM LatestRates;
+
+currency  rate
+========= ====
+US Dollar 102
+Euro      116
+Yen       1
 {% endhighlight %}
 
-The correlated subquery determines the maximum time for the corresponding currency that is lower or equal than the desired time. The outer query lists the rates that have a maximum timestamp.
+In Flink, this is represented by a [*regular Table*](#defining-regular-table).
+
+Temporal Table
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.
 
-The following table shows the result of such a computation. In our example, the update to `Euro` at `10:45` is taken into account, however, the update to `Euro` at `11:15` and the new entry of `Pounds` are not considered in the table's version at time `10:58`.
+Flink uses primary key constraint and event time to define both versioned table and versioned view.
 
-{% highlight text %}
-rowtime currency   rate
-======= ======== ======
-09:00   US Dollar   102
-09:00   Yen           1
-10:45   Euro        116
+### Defining Versioned Table
+The table is a versioned table in Flink only is the table contains primary key constraint and event time.
+{% highlight sql %}
+-- Define a versioned table
+CREATE TABLE product_changelog (
+  product_id STRING,
+  product_name STRING,
+  product_price DECIMAL(10, 4),
+  update_time TIMESTAMP(3) METADATA FROM 'value.source.timestamp' VIRTUAL,
+  PRIMARY KEY(product_id) NOT ENFORCED,      -- (1) defines the primary key constraint
+  WATERMARK FOR update_time AS update_time   -- (2) defines the event time by watermark                               
+) WITH (
+  'connector' = 'kafka',
+  'topic' = 'products',
+  'scan.startup.mode' = 'earliest-offset',
+  'properties.bootstrap.servers' = 'localhost:9092',
+  'value.format' = 'debezium-json'
+);
 {% endhighlight %}
 
-The concept of *Temporal Tables* aims to simplify such queries, speed up their execution, and reduce Flink's state usage. A *Temporal Table* is a parameterized view on an append-only table that interprets the rows of the append-only table as the changelog of a table and provides the version of that table at a specific point in time. Interpreting the append-only table as a changelog requires the specification of a primary key attribute and a timestamp attribute. The primary key determines which rows are overwritten and the timestamp determines the time during which a row is valid.
+Line `(1)` defines the primary key constraint for table `product_changelog`, Line `(2)` defines the `update_time` as event time for table `product_changelog`,
+thus table `product_changelog` is a versioned table.
 
-In the above example `currency` would be a primary key for `RatesHistory` table and `rowtime` would be the timestamp attribute.
+**Note**: The grammar `METADATA FROM 'value.source.timestamp' VIRTUAL` means extract the database
+operation execution time for every changelog, it's strongly recommended defines the database operation execution time 
+as event time rather than ingestion-time or time in the record, otherwise the version extract from the changelog may
+mismatch with the version in database.
+ 
+### Defining Versioned View
 
-In Flink, this is represented by a [*Temporal Table Function*](#temporal-table-function).
+Flink also supports defining versioned view only if the view contains unique key constraint and event time.
+ 
+Let’s assume that we have the following table `RatesHistory`:
+{% highlight sql %}
+-- Define an append-only table
+CREATE TABLE RatesHistory (
+    currency_time TIMESTAMP(3),
+    currency STRING,
+    rate DECIMAL(38, 10),
+    WATERMARK FOR currency_time AS currency_time   -- defines the event time
+) WITH (
+  'connector' = 'kafka',
+  'topic' = 'rates',
+  'scan.startup.mode' = 'earliest-offset',
+  'properties.bootstrap.servers' = 'localhost:9092',
+  'format' = 'json'                                -- this is an append only source
+)
+{% endhighlight %}
 
-### Correlate with a changing dimension table
+Table `RatesHistory` represents an ever growing append-only table of currency exchange rates with respect to 
+Yen (which has a rate of 1). For example, the exchange rate for the period from 09:00 to 10:45 of Euro to Yen was 114.
+From 10:45 to 11:15 it was 116.
+
+{% highlight sql %}
+SELECT * FROM RatesHistory;
 
-On the other hand, some use cases require to join a changing dimension table which is an external database table.
+currency_time currency  rate
+============= ========= ====
+09:00:00      US Dollar 102
+09:00:00      Euro      114
+09:00:00      Yen       1
+10:45:00      Euro      116
+11:15:00      Euro      119
+11:49:00      Pounds    108
+{% endhighlight %}
 
-Let's assume that `LatestRates` is a table (e.g. stored in HBase) which is materialized with the latest rate. The `LatestRates` is the materialized history `RatesHistory`. Then the content of `LatestRates` table at time `10:58` will be:
+To define a versioned table on `RatesHistory`, Flink supports defining a versioned view 
+by [deduplication query]({{ site.baseurl }}/dev/table/sql/queries.html#deduplication) which produces an ordered changelog
+stream with an inferred primary key(`currency`) and event time(`currency_time`).
 
-{% highlight text %}
-10:58> SELECT * FROM LatestRates;
-currency   rate
-======== ======
-US Dollar   102
-Yen           1
-Euro        116
+{% highlight sql %}
+-- Define a versioned view
+CREATE VIEW versioned_rates AS              
+SELECT currency, rate, currency_time            -- (1) `currency_time` keeps the event time
+  FROM (
+      SELECT *,
+      ROW_NUMBER() OVER (PARTITION BY currency  -- (2) the inferred unique key `currency` can be a primary key
+         ORDER BY currency_time DESC) AS rowNum 
+      FROM rates )

Review comment:
       Make sure the examples are "runnable" We should use the `RatesHistory` table here.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on a change in pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
leonardBang commented on a change in pull request #14152:
URL: https://github.com/apache/flink/pull/14152#discussion_r533162365



##########
File path: docs/dev/table/streaming/joins.zh.md
##########
@@ -68,6 +68,189 @@ WHERE o.id = s.orderId AND
 
 <a name="join-with-a-temporal-table-function"></a>
 
+时态表 Join
+--------------------------
+<span class="label label-danger">注意</span> 只在 Blink planner 中支持。
+<span class="label label-danger">注意</span> 时态表有两种方式去定义,即 [时态表函数]({% link dev/table/streaming/temporal_tables.zh.md %)#时态表函数) 和 [时态表 DDL]({% link dev/table/streaming/temporal_tables.zh.md %}#时态表),使用时态表函数的时态表 join 只支持在 Table API 中使用,使用时态表 DDL 的时态表 join 只支持在 SQL 中使用。

Review comment:
       thanks @xintongsong 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] morsapaes edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
morsapaes edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-733399714


   **Update: Nevermind, the file diff just wasn't expanded and I missed it in the changes. 👍 **
   
   @leonardBang, @sjwiesman : since FLIP-132 revised a couple of fundamental concepts and also introduced support for changelog streams as temporal table sources, it might be that it invalidates some of the information in [this documentation page](https://ci.apache.org/projects/flink/flink-docs-master/dev/table/streaming/temporal_tables.html). Should this also be addressed at some point to avoid having inconsistent information?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082",
       "triggerID" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dfa09ece231af0ac4c36c21c9b192aa97c6b70f1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "dfa09ece231af0ac4c36c21c9b192aa97c6b70f1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 25f4b1496af119c99555cfaf302a8eca568b1b8f Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082) 
   * dfa09ece231af0ac4c36c21c9b192aa97c6b70f1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
leonardBang commented on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-733406540


   > **Update: Nevermind, the file diff just wasn't expanded and I missed it in the changes.** 👍
   > 
   > @leonardBang, @sjwiesman : since FLIP-132 revised a couple of fundamental concepts and also introduced support for changelog streams as temporal table sources, it might be that it invalidates some of the information in [this documentation page](https://ci.apache.org/projects/flink/flink-docs-master/dev/table/streaming/temporal_tables.html). Should this also be addressed at some point to avoid having inconsistent information?
   
   You're wright, @morsapaes , in fact  this PR  has updated this part, you can lookup files(`docs/dev/table/streaming/temporal_tables.md` and `docs/dev/table/streaming/temporal_tables.zh.md`)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082",
       "triggerID" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 73c56532be54d68d2a2a79644eaea49543e00811 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004) 
   * 25f4b1496af119c99555cfaf302a8eca568b1b8f Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] morsapaes edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
morsapaes edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-733399714






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082",
       "triggerID" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dfa09ece231af0ac4c36c21c9b192aa97c6b70f1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10306",
       "triggerID" : "dfa09ece231af0ac4c36c21c9b192aa97c6b70f1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 25f4b1496af119c99555cfaf302a8eca568b1b8f Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082) 
   * dfa09ece231af0ac4c36c21c9b192aa97c6b70f1 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10306) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
leonardBang commented on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-735560931


   @sjwiesman I've rebased again, do you have time to have a look? thanks.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
leonardBang commented on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-732678913


   @sjwiesman I've addressed the comments, appreciate if you can take a look again.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875) 
   * 73c56532be54d68d2a2a79644eaea49543e00811 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] xintongsong commented on a change in pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
xintongsong commented on a change in pull request #14152:
URL: https://github.com/apache/flink/pull/14152#discussion_r533161479



##########
File path: docs/dev/table/streaming/joins.zh.md
##########
@@ -68,6 +68,189 @@ WHERE o.id = s.orderId AND
 
 <a name="join-with-a-temporal-table-function"></a>
 
+时态表 Join
+--------------------------
+<span class="label label-danger">注意</span> 只在 Blink planner 中支持。
+<span class="label label-danger">注意</span> 时态表有两种方式去定义,即 [时态表函数]({% link dev/table/streaming/temporal_tables.zh.md %)#时态表函数) 和 [时态表 DDL]({% link dev/table/streaming/temporal_tables.zh.md %}#时态表),使用时态表函数的时态表 join 只支持在 Table API 中使用,使用时态表 DDL 的时态表 join 只支持在 SQL 中使用。

Review comment:
       FYI: There's a broken link `[时态表函数]({% link dev/table/streaming/temporal_tables.zh.md %)#时态表函数)` that prevent the docs from being built. A `{` is mismatched with a `)`.
   
   I'm fixing this in #14241.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 73c56532be54d68d2a2a79644eaea49543e00811 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004) 
   * 25f4b1496af119c99555cfaf302a8eca568b1b8f UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875) 
   * 73c56532be54d68d2a2a79644eaea49543e00811 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on a change in pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
leonardBang commented on a change in pull request #14152:
URL: https://github.com/apache/flink/pull/14152#discussion_r531342302



##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,174 +65,147 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
-Join with a Temporal Table Function
---------------------------
-
-A join with a temporal table function joins an append-only table (left input/probe side) with a temporal table (right input/build side),
-i.e., a table that changes over time and tracks its changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This feature is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention it is only supported in SQL, and not supported in Table API yet.

Review comment:
       I agree your point, @morsapaes . Old temporal joins(using temporal table function + `lateral`) is still supported in Table API, the newborn temporal join(using temporal table DDL + temporal join syntax) is supported in SQL.
   How about :
   ```
   Temporal table has ways to define in Flink, i.e. [temporal table function]({% link dev/table/streaming/temporal_tables.md %}#temporal-table-function) ) and [temporal table DDL](({% link dev/table/streaming/temporal_tables.md %}#temporal-table-ddl)).
   Temporal join that using temporal table function is only supported in Table API,  temporal join that using temporal table DDL is only supported in SQL, please see the page [temporal table]({% link dev/table/streaming/temporal_tables.md %}) for more information about the differences between temporal table function and temporal table DDL.
   ```
    




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731138950


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2 (Fri Nov 20 12:22:06 UTC 2020)
   
    ✅no warnings
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] morsapaes commented on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
morsapaes commented on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-733399714


   @leonardBang, @sjwiesman : since FLIP-132 revised a couple of fundamental concepts and also introduced support for changelog streams as temporal table sources, it might be that it invalidates some of the information in [this documentation page](https://ci.apache.org/projects/flink/flink-docs-master/dev/table/streaming/temporal_tables.html). Should this also be addressed at some point to avoid having inconsistent information?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082",
       "triggerID" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 25f4b1496af119c99555cfaf302a8eca568b1b8f Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10082",
       "triggerID" : "25f4b1496af119c99555cfaf302a8eca568b1b8f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dfa09ece231af0ac4c36c21c9b192aa97c6b70f1",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10306",
       "triggerID" : "dfa09ece231af0ac4c36c21c9b192aa97c6b70f1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * dfa09ece231af0ac4c36c21c9b192aa97c6b70f1 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10306) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] sjwiesman commented on a change in pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
sjwiesman commented on a change in pull request #14152:
URL: https://github.com/apache/flink/pull/14152#discussion_r528878500



##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,6 +65,220 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.

Review comment:
       ```suggestion
   <span class="label label-danger">Attention</span> This feature is only supported in Blink planner.
   ```

##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,6 +65,220 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention It is only supported in SQL, and not supported in Table API yet.
+
+Temporal join is an arbitrary table (left input/probe side) correlate with the versions of temporal table (right input/build side), The temporal table can be an external dimension table that changes over time 
+or a changelog that tracks all history changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+
+Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011. The syntax of temporal table join is as follows:
+
+{% highlight sql %}
+SELECT [column_list]
+FROM table1 [AS <alias1>]
+[LEFT] JOIN table2 FOR SYSTEM_TIME AS OF table1.{ proctime | rowtime } [AS <alias2>]
+ON table1.column-name1 = table2.column-name1
+{% endhighlight %}
+
+### Processing-time Temporal Joins
+
+Processing-time temporal join is the left input table using it's processing time to correlate the latest version of [regular table](temporal_tables.html#defining-regular-table) in a temporal join.
+Processing-time temporal join only supports regular table currently, and the supported regular table table can only contain append-only stream. 
+
+With a processing-time time attribute, it is impossible to pass _past_ time attributes as an argument to the temporal table.

Review comment:
       ```suggestion
   With a processing-time time attribute, it is impossible to use a _past_ time attribute as an argument to the temporal table.
   ```

##########
File path: docs/dev/table/streaming/temporal_tables.md
##########
@@ -20,103 +20,255 @@ software distributed under the License is distributed on an
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
--->
+--> 
 
-Temporal Tables represent a concept of a (parameterized) view on a changing table that returns the content of a table at a specific point in time.
+Temporal table is a table that evolves over time as known as Flink [dynamic table](dynamic_tables.html), rows in temporal table are associated with one or more temporal periods, all Flink tables are temporal(dynamic) table.

Review comment:
       ```suggestion
   A temporal table is a table that evolves over time -  otherwise known in Flink as a [dynamic table](dynamic_tables.html). Rows in a temporal table are associated with one or more temporal periods and all Flink tables are temporal(dynamic).
   ```

##########
File path: docs/dev/table/streaming/temporal_tables.md
##########
@@ -20,103 +20,255 @@ software distributed under the License is distributed on an
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
--->
+--> 
 
-Temporal Tables represent a concept of a (parameterized) view on a changing table that returns the content of a table at a specific point in time.
+Temporal table is a table that evolves over time as known as Flink [dynamic table](dynamic_tables.html), rows in temporal table are associated with one or more temporal periods, all Flink tables are temporal(dynamic) table.
 
-The changing table can either be a changing history table which tracks the changes (e.g. database changelogs) or a changing dimension table which materializes the changes (e.g. database tables).
+A temporal table contains one or more versioned table snapshots, it can be a changing history table which tracks the changes(e.g. database changelog, contains all snapshots) or a changing dimensioned table which materializes the changes(e.g. database table, contains the latest snapshot). 
 
-For the changing history table, Flink can keep track of the changes and allows for accessing the content of the table at a certain point in time within a query. In Flink, this kind of table is represented by a *Temporal Table Function*.
+**Version**: A temporal table can split into a set of versioned table snapshots, the version in table snapshots represents the valid life circle of rows, the start time and the end time of the valid period can be assigned by users. 
+Temporal table can split to `versioned table` and `regular table` according to the table can tracks its history version or not.
 
-For the changing dimension table, Flink allows for accessing the content of the table at processing time within a query. In Flink, this kind of table is represented by a *Temporal Table*.
+**Versioned table**: If the row in temporal table can track its history changes and visit its history versions, we call this kind of temporal table as versioned table, the table comes from database changelog can define as a versioned table.
+
+**Regular table**: If the row in temporal table can only track and visit its latest version,we call this kind of temporal table as regular table. The table comes from database or HBase can define as a regular table.

Review comment:
       ```suggestion
   **Versioned table**: If the rows in a temporal table can track its history changes and visit its history versions, we call this a versioned table. Tables that comes from a database changelog can be defined as a versioned table.
   
   **Regular table**: If the rows in a temporal table can only track and visit its latest version, we call this a regular table. Tables that comes from a database or HBase can be defined as a regular table.
   ```

##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,6 +65,220 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention It is only supported in SQL, and not supported in Table API yet.
+
+Temporal join is an arbitrary table (left input/probe side) correlate with the versions of temporal table (right input/build side), The temporal table can be an external dimension table that changes over time 
+or a changelog that tracks all history changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+
+Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011. The syntax of temporal table join is as follows:

Review comment:
       ```suggestion
   Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011 standard. The syntax of a temporal table join is as follows:
   ```

##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,6 +65,220 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention It is only supported in SQL, and not supported in Table API yet.
+
+Temporal join is an arbitrary table (left input/probe side) correlate with the versions of temporal table (right input/build side), The temporal table can be an external dimension table that changes over time 
+or a changelog that tracks all history changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+
+Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011. The syntax of temporal table join is as follows:
+
+{% highlight sql %}
+SELECT [column_list]
+FROM table1 [AS <alias1>]
+[LEFT] JOIN table2 FOR SYSTEM_TIME AS OF table1.{ proctime | rowtime } [AS <alias2>]
+ON table1.column-name1 = table2.column-name1
+{% endhighlight %}
+
+### Processing-time Temporal Joins
+
+Processing-time temporal join is the left input table using it's processing time to correlate the latest version of [regular table](temporal_tables.html#defining-regular-table) in a temporal join.

Review comment:
       ```suggestion
   Processing-time temporal join uses the left input tables processing time attribute to correlate the latest version of a [regular table](temporal_tables.html#defining-regular-table).
   ```

##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,6 +65,220 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention It is only supported in SQL, and not supported in Table API yet.
+
+Temporal join is an arbitrary table (left input/probe side) correlate with the versions of temporal table (right input/build side), The temporal table can be an external dimension table that changes over time 
+or a changelog that tracks all history changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+
+Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011. The syntax of temporal table join is as follows:
+
+{% highlight sql %}
+SELECT [column_list]
+FROM table1 [AS <alias1>]
+[LEFT] JOIN table2 FOR SYSTEM_TIME AS OF table1.{ proctime | rowtime } [AS <alias2>]
+ON table1.column-name1 = table2.column-name1
+{% endhighlight %}
+
+### Processing-time Temporal Joins
+
+Processing-time temporal join is the left input table using it's processing time to correlate the latest version of [regular table](temporal_tables.html#defining-regular-table) in a temporal join.
+Processing-time temporal join only supports regular table currently, and the supported regular table table can only contain append-only stream. 
+
+With a processing-time time attribute, it is impossible to pass _past_ time attributes as an argument to the temporal table.
+By definition, it is always the current timestamp. Thus, invocations of correlating temporal table 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.
+
+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`.
+
+The following processing-time temporal table join example shows an append-only table `orders` that should be joined with the table `LatestRates`,
+`LatestRates` is a dimension table (e.g. HBase table) that is materialized with the latest rate. At time `10:15`, `10:30`, `10:52`, the content of `LatestRates` looks as follows:
+
+{% highlight sql %}
+10:15> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        114
+Yen           1
+
+10:30> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        114
+Yen           1
+
+10:52> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        116     <==== changed from 114 to 116
+Yen           1
+{% endhighlight %}
+
+The content of `LastestRates` at time `10:15` and `10:30` are equal. The Euro rate has changed from 114 to 116 at `10:52`.
+
+`Orders` is an append-only table that represents payments for the given `amount` and the given `currency`. For example at `10:15` there was an order for an amount of `2 Euro`.
+
+{% highlight sql %}
+SELECT * FROM Orders;
+
+amount currency
+====== =========
+     2 Euro             <== arrived at time 10:15
+     1 US Dollar        <== arrived at time 10:30
+     2 Euro             <== arrived at time 10:52
+{% endhighlight %}
+
+Given that we would like to calculate the amount of all `Orders` converted to a common currency (`Yen`).
+
+For example, we would like to convert the following orders using the latest rate in `LatestRates`. The result would be:
+
+{% highlight text %}
+amount currency     rate   amout*rate
+====== ========= ======= ============
+     2 Euro          114          228    <== arrived at time 10:15
+     1 US Dollar     102          102    <== arrived at time 10:30
+     2 Euro          116          232    <== arrived at time 10:52
+{% endhighlight %}
+
+
+With the help of temporal table join, we can express such a query in SQL as:
+
+{% highlight sql %}
+SELECT
+  o.amout, o.currency, r.rate, o.amount * r.rate
+FROM
+  Orders AS o
+  JOIN LatestRates FOR SYSTEM_TIME AS OF o.proctime AS r
+  ON r.currency = o.currency
+{% endhighlight %}
+
+Each record from the probe side will be joined with the current version of the build side table. In our example, the query is using the processing-time notion, so a newly appended order would always be joined with the most recent version of `LatestRates` when executing the operation.
+Note that the result is not deterministic for processing-time.
+The processing-time temporal join is usually used to enrich the stream with external table (i.e. dimension table).
+
+### Event-time Temporal Joins
+
+Event-time temporal join is the left input table using it's event time to correlate the corresponding version of [versioned table](temporal_tables.html#defining-versioned-table) in a temporal join.
+Event-time temporal join only supports versioned table, the versioned table table need to be a changelog stream, the append-only stream can convert to changelog stream in Flink, thus the versioned table can come from an append-only stream,

Review comment:
       ```suggestion
   Event-time temporal join only supports versioned tables and the versioned tables need to be a changelog stream. However, an append-only stream can be converted to a changelog stream in Flink, thus the versioned table can come from an append-only stream,
   ```

##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,6 +65,220 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention It is only supported in SQL, and not supported in Table API yet.
+
+Temporal join is an arbitrary table (left input/probe side) correlate with the versions of temporal table (right input/build side), The temporal table can be an external dimension table that changes over time 
+or a changelog that tracks all history changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+
+Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011. The syntax of temporal table join is as follows:
+
+{% highlight sql %}
+SELECT [column_list]
+FROM table1 [AS <alias1>]
+[LEFT] JOIN table2 FOR SYSTEM_TIME AS OF table1.{ proctime | rowtime } [AS <alias2>]
+ON table1.column-name1 = table2.column-name1
+{% endhighlight %}
+
+### Processing-time Temporal Joins
+
+Processing-time temporal join is the left input table using it's processing time to correlate the latest version of [regular table](temporal_tables.html#defining-regular-table) in a temporal join.
+Processing-time temporal join only supports regular table currently, and the supported regular table table can only contain append-only stream. 
+
+With a processing-time time attribute, it is impossible to pass _past_ time attributes as an argument to the temporal table.
+By definition, it is always the current timestamp. Thus, invocations of correlating temporal table 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.
+
+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`.
+
+The following processing-time temporal table join example shows an append-only table `orders` that should be joined with the table `LatestRates`,
+`LatestRates` is a dimension table (e.g. HBase table) that is materialized with the latest rate. At time `10:15`, `10:30`, `10:52`, the content of `LatestRates` looks as follows:
+
+{% highlight sql %}
+10:15> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        114
+Yen           1
+
+10:30> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        114
+Yen           1
+
+10:52> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        116     <==== changed from 114 to 116
+Yen           1
+{% endhighlight %}
+
+The content of `LastestRates` at time `10:15` and `10:30` are equal. The Euro rate has changed from 114 to 116 at `10:52`.
+
+`Orders` is an append-only table that represents payments for the given `amount` and the given `currency`. For example at `10:15` there was an order for an amount of `2 Euro`.
+
+{% highlight sql %}
+SELECT * FROM Orders;
+
+amount currency
+====== =========
+     2 Euro             <== arrived at time 10:15
+     1 US Dollar        <== arrived at time 10:30
+     2 Euro             <== arrived at time 10:52
+{% endhighlight %}
+
+Given that we would like to calculate the amount of all `Orders` converted to a common currency (`Yen`).
+
+For example, we would like to convert the following orders using the latest rate in `LatestRates`. The result would be:
+
+{% highlight text %}
+amount currency     rate   amout*rate
+====== ========= ======= ============
+     2 Euro          114          228    <== arrived at time 10:15
+     1 US Dollar     102          102    <== arrived at time 10:30
+     2 Euro          116          232    <== arrived at time 10:52
+{% endhighlight %}
+
+
+With the help of temporal table join, we can express such a query in SQL as:
+
+{% highlight sql %}
+SELECT
+  o.amout, o.currency, r.rate, o.amount * r.rate
+FROM
+  Orders AS o
+  JOIN LatestRates FOR SYSTEM_TIME AS OF o.proctime AS r
+  ON r.currency = o.currency
+{% endhighlight %}
+
+Each record from the probe side will be joined with the current version of the build side table. In our example, the query is using the processing-time notion, so a newly appended order would always be joined with the most recent version of `LatestRates` when executing the operation.
+Note that the result is not deterministic for processing-time.
+The processing-time temporal join is usually used to enrich the stream with external table (i.e. dimension table).
+
+### Event-time Temporal Joins
+
+Event-time temporal join is the left input table using it's event time to correlate the corresponding version of [versioned table](temporal_tables.html#defining-versioned-table) in a temporal join.
+Event-time temporal join only supports versioned table, the versioned table table need to be a changelog stream, the append-only stream can convert to changelog stream in Flink, thus the versioned table can come from an append-only stream,
+please see [versioned view](temporal_tables.html#defining-versioned-view) for more information to know how to define a versioned table from an append-only stream.
+
+With an event-time time attribute (i.e., a rowtime attribute), it is possible to pass _past_ time attributes to the temporal table.

Review comment:
       ```suggestion
   With an event-time time attribute (i.e., a rowtime attribute), it is possible to use a _past_ time attribute with the temporal table.
   ```

##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,6 +65,220 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention It is only supported in SQL, and not supported in Table API yet.
+
+Temporal join is an arbitrary table (left input/probe side) correlate with the versions of temporal table (right input/build side), The temporal table can be an external dimension table that changes over time 
+or a changelog that tracks all history changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+
+Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011. The syntax of temporal table join is as follows:
+
+{% highlight sql %}
+SELECT [column_list]
+FROM table1 [AS <alias1>]
+[LEFT] JOIN table2 FOR SYSTEM_TIME AS OF table1.{ proctime | rowtime } [AS <alias2>]
+ON table1.column-name1 = table2.column-name1
+{% endhighlight %}
+
+### Processing-time Temporal Joins
+
+Processing-time temporal join is the left input table using it's processing time to correlate the latest version of [regular table](temporal_tables.html#defining-regular-table) in a temporal join.
+Processing-time temporal join only supports regular table currently, and the supported regular table table can only contain append-only stream. 
+
+With a processing-time time attribute, it is impossible to pass _past_ time attributes as an argument to the temporal table.
+By definition, it is always the current timestamp. Thus, invocations of correlating temporal table 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.
+
+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`.
+
+The following processing-time temporal table join example shows an append-only table `orders` that should be joined with the table `LatestRates`,
+`LatestRates` is a dimension table (e.g. HBase table) that is materialized with the latest rate. At time `10:15`, `10:30`, `10:52`, the content of `LatestRates` looks as follows:
+
+{% highlight sql %}
+10:15> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        114
+Yen           1
+
+10:30> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        114
+Yen           1
+
+10:52> SELECT * FROM LatestRates;
+
+currency   rate
+======== ======
+US Dollar   102
+Euro        116     <==== changed from 114 to 116
+Yen           1
+{% endhighlight %}
+
+The content of `LastestRates` at time `10:15` and `10:30` are equal. The Euro rate has changed from 114 to 116 at `10:52`.
+
+`Orders` is an append-only table that represents payments for the given `amount` and the given `currency`. For example at `10:15` there was an order for an amount of `2 Euro`.
+
+{% highlight sql %}
+SELECT * FROM Orders;
+
+amount currency
+====== =========
+     2 Euro             <== arrived at time 10:15
+     1 US Dollar        <== arrived at time 10:30
+     2 Euro             <== arrived at time 10:52
+{% endhighlight %}
+
+Given that we would like to calculate the amount of all `Orders` converted to a common currency (`Yen`).
+
+For example, we would like to convert the following orders using the latest rate in `LatestRates`. The result would be:
+
+{% highlight text %}
+amount currency     rate   amout*rate
+====== ========= ======= ============
+     2 Euro          114          228    <== arrived at time 10:15
+     1 US Dollar     102          102    <== arrived at time 10:30
+     2 Euro          116          232    <== arrived at time 10:52
+{% endhighlight %}
+
+
+With the help of temporal table join, we can express such a query in SQL as:
+
+{% highlight sql %}
+SELECT
+  o.amout, o.currency, r.rate, o.amount * r.rate
+FROM
+  Orders AS o
+  JOIN LatestRates FOR SYSTEM_TIME AS OF o.proctime AS r
+  ON r.currency = o.currency
+{% endhighlight %}
+
+Each record from the probe side will be joined with the current version of the build side table. In our example, the query is using the processing-time notion, so a newly appended order would always be joined with the most recent version of `LatestRates` when executing the operation.
+Note that the result is not deterministic for processing-time.
+The processing-time temporal join is usually used to enrich the stream with external table (i.e. dimension table).
+
+### Event-time Temporal Joins

Review comment:
       Can you please move event time temporal joins above processing time? I think this is the more common use case. 

##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,6 +65,220 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention It is only supported in SQL, and not supported in Table API yet.
+
+Temporal join is an arbitrary table (left input/probe side) correlate with the versions of temporal table (right input/build side), The temporal table can be an external dimension table that changes over time 
+or a changelog that tracks all history changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+
+Flink uses the SQL syntax of `FOR SYSTEM_TIME AS OF` to query temporal table, which is proposed in SQL:2011. The syntax of temporal table join is as follows:
+
+{% highlight sql %}
+SELECT [column_list]
+FROM table1 [AS <alias1>]
+[LEFT] JOIN table2 FOR SYSTEM_TIME AS OF table1.{ proctime | rowtime } [AS <alias2>]
+ON table1.column-name1 = table2.column-name1
+{% endhighlight %}
+
+### Processing-time Temporal Joins
+
+Processing-time temporal join is the left input table using it's processing time to correlate the latest version of [regular table](temporal_tables.html#defining-regular-table) in a temporal join.
+Processing-time temporal join only supports regular table currently, and the supported regular table table can only contain append-only stream. 

Review comment:
       ```suggestion
   Processing-time temporal join only supports regular tables currently, and the supported regular table can only contain append-only stream. 
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] sjwiesman closed pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
sjwiesman closed pull request #14152:
URL: https://github.com/apache/flink/pull/14152


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14152:
URL: https://github.com/apache/flink/pull/14152#issuecomment-731145130


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=9875",
       "triggerID" : "b1eba2d1cb39eb71b0ff21b15d69c6b20c54e4a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004",
       "triggerID" : "73c56532be54d68d2a2a79644eaea49543e00811",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 73c56532be54d68d2a2a79644eaea49543e00811 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10004) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] morsapaes commented on a change in pull request #14152: [FLINK-19082][doc] Add docs for temporal table and temporal table join

Posted by GitBox <gi...@apache.org>.
morsapaes commented on a change in pull request #14152:
URL: https://github.com/apache/flink/pull/14152#discussion_r531129324



##########
File path: docs/dev/table/streaming/joins.md
##########
@@ -65,174 +65,147 @@ WHERE o.id = s.orderId AND
 
 Compared to a regular join operation, this kind of join only supports append-only tables with time attributes. Since time attributes are quasi-monotonic increasing, Flink can remove old values from its state without affecting the correctness of the result.
 
-Join with a Temporal Table Function
---------------------------
-
-A join with a temporal table function joins an append-only table (left input/probe side) with a temporal table (right input/build side),
-i.e., a table that changes over time and tracks its changes. Please check the corresponding page for more information about [temporal tables](temporal_tables.html).
+Temporal Joins
+--------------
+<span class="label label-danger">Attention</span> This feature is only supported in Blink planner.
+<span class="label label-danger">Attention</span> Attention it is only supported in SQL, and not supported in Table API yet.

Review comment:
       Aren't temporal joins still supported in the Table API using the old method (and listed [here](https://ci.apache.org/projects/flink/flink-docs-release-1.12/dev/table/tableApi.html#joins))? If so, this sentence is a bit misleading.




----------------------------------------------------------------
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:
users@infra.apache.org