[ 
https://issues.apache.org/jira/browse/FLINK-9737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16660226#comment-16660226
 ] 

ASF GitHub Bot commented on FLINK-9737:
---------------------------------------

pnowojski 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_r227267053
 
 

 ##########
 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
 
 Review comment:
   `changing-table` is not very good name and it's inconsistent with already 
used nomenclature, that even you are using here. Please change it to 
`underlying-table`, `underlying-history-table`, `history-table` or something 
like that. If you think that there is some better name, please also make the 
effort to rename existing `underlyingHistoryTable` occurrences in the source 
code.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Allow to define Table Version Functions from SQL environment file
> -----------------------------------------------------------------
>
>                 Key: FLINK-9737
>                 URL: https://issues.apache.org/jira/browse/FLINK-9737
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API &amp; SQL
>    Affects Versions: 1.5.0
>            Reporter: Piotr Nowojski
>            Assignee: Timo Walther
>            Priority: Major
>              Labels: pull-request-available
>
> It should be possible to define TVF from SQL environment file.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to