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 2018/10/23 07:18:57 UTC

[GitHub] twalthr commented on a change in pull request #6897: [FLINK-9737] [FLINK-8880] [sql-client] Support defining temporal tables in environment files

twalthr commented on a change in pull request #6897: [FLINK-9737] [FLINK-8880] [sql-client] Support defining temporal tables in environment files
URL: https://github.com/apache/flink/pull/6897#discussion_r227254032
 
 

 ##########
 File path: docs/dev/table/sqlClient.md
 ##########
 @@ -503,7 +504,49 @@ Views created within a CLI session can also be removed again using the `DROP VIE
 DROP VIEW MyNewView;
 {% endhighlight %}
 
-<span class="label label-danger">Attention</span> The definition of views is limited to the mentioned syntax above. Defining a schema for views or escape whitespaces in table names will be supported in future versions.
+<span class="label label-danger">Attention</span> The definition of views in the CLI is limited to the mentioned syntax above. Defining a schema for views or escaping whitespaces in table names will be supported in future versions.
+
+{% top %}
+
+Temporal Tables
+---------------
+
+A [temporal table](./streaming/temporal_tables.html) allows for a (parameterized) view on a changing history table that returns the content of a table at a specific point in time. This is especially useful for joining a table with the content of another table at a particular timestamp. More information can be found in the [temporal table joins](./streaming/joins.html#join-with-a-temporal-table) page.
+
+The following example shows how to define a temporal table `SourceTemporalTable`:
+
+{% highlight yaml %}
+tables:
+
+  # Define the table source (or view) that contains updates to a temporal table
+  - name: HistorySource
+    type: source-table
+    update-mode: append
+    connector: # ...
+    format: # ...
+    schema:
+      - name: integerField
+        type: INT
+      - name: stringField
+        type: VARCHAR
+      - name: rowtimeField
+        type: TIMESTAMP
+        rowtime:
+          timestamps:
+            type: from-field
+            from: rowtimeField
+          watermarks:
+            type: from-source
+
+  # Define a temporal table over the changing history table with time attribute and primary key
+  - name: SourceTemporalTable
+    type: temporal-table
+    changing-table: HistorySource
+    primary-key: integerField
+    time-attribute: rowtimeField
+{% endhighlight %}
+
+Similar to views, temporal tables are registered in the order in which they are defined in the environment file.
 
 Review comment:
   I added the following lines:
   
   "As shown in the example, definitions of table sources, views, and temporal tables can be mixed with each other. They are registered in the order in which they are defined in the environment file. For example, a temporal table can reference a view which can depend on another view or table source."

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


With regards,
Apache Git Services