You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fh...@apache.org on 2017/10/25 20:02:15 UTC
[2/3] flink git commit: [FLINK-6584] [docs] Add ROWTIME and PROCTIME
group window functions to documentation.
[FLINK-6584] [docs] Add ROWTIME and PROCTIME group window functions to documentation.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/14e0948a
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/14e0948a
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/14e0948a
Branch: refs/heads/master
Commit: 14e0948a94765bcf2cc30c7c3f202a3bcc1f5dca
Parents: 2ad8f7e
Author: Fabian Hueske <fh...@apache.org>
Authored: Tue Oct 24 21:45:06 2017 +0200
Committer: Fabian Hueske <fh...@apache.org>
Committed: Wed Oct 25 18:53:30 2017 +0200
----------------------------------------------------------------------
docs/dev/table/sql.md | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/14e0948a/docs/dev/table/sql.md
----------------------------------------------------------------------
diff --git a/docs/dev/table/sql.md b/docs/dev/table/sql.md
index 0eef48b..22eca0d 100644
--- a/docs/dev/table/sql.md
+++ b/docs/dev/table/sql.md
@@ -660,7 +660,7 @@ For SQL on batch tables, the `time_attr` argument of the group window function m
#### Selecting Group Window Start and End Timestamps
-The start and end timestamps of group windows can be selected with the following auxiliary functions:
+The start and end timestamps of group windows as well as time attributes can be selected with the following auxiliary functions:
<table class="table table-bordered">
<thead>
@@ -677,7 +677,7 @@ The start and end timestamps of group windows can be selected with the following
<code>HOP_START(time_attr, interval, interval)</code><br/>
<code>SESSION_START(time_attr, interval)</code><br/>
</td>
- <td>Returns the start timestamp of the corresponding tumbling, hopping, and session window.</td>
+ <td><p>Returns the timestamp of the inclusive lower bound of the corresponding tumbling, hopping, or session window.</p></td>
</tr>
<tr>
<td>
@@ -685,7 +685,25 @@ The start and end timestamps of group windows can be selected with the following
<code>HOP_END(time_attr, interval, interval)</code><br/>
<code>SESSION_END(time_attr, interval)</code><br/>
</td>
- <td>Returns the end timestamp of the corresponding tumbling, hopping, and session window.</td>
+ <td><p>Returns the timestamp of the <i>exclusive</i> upper bound of the corresponding tumbling, hopping, or session window.</p>
+ <p><b>Note:</b> The exclusive upper bound timestamp <i>cannot</i> be used as a <a href="streaming.html#time-attributes">rowtime attribute</a> in subsequent time-based operations, such as <a href="#joins">time-windowed joins</a> and <a href="#aggregations">group window or over window aggregations</a>.</p></td>
+ </tr>
+ <tr>
+ <td>
+ <code>TUMBLE_ROWTIME(time_attr, interval)</code><br/>
+ <code>HOP_ROWTIME(time_attr, interval, interval)</code><br/>
+ <code>SESSION_ROWTIME(time_attr, interval)</code><br/>
+ </td>
+ <td><p>Returns the timestamp of the <i>inclusive</i> upper bound of the corresponding tumbling, hopping, or session window.</p>
+ <p>The resulting attribute is a <a href="streaming.html#time-attributes">rowtime attribute</a> that can be used in subsequent time-based operations such as <a href="#joins">time-windowed joins</a> and <a href="#aggregations">group window or over window aggregations</a>.</p></td>
+ </tr>
+ <tr>
+ <td>
+ <code>TUMBLE_PROCTIME(time_attr, interval)</code><br/>
+ <code>HOP_PROCTIME(time_attr, interval, interval)</code><br/>
+ <code>SESSION_PROCTIME(time_attr, interval)</code><br/>
+ </td>
+ <td><p>Returns a <a href="streaming.html#time-attributes">proctime attribute</a> that can be used in subsequent time-based operations such as <a href="#joins">time-windowed joins</a> and <a href="#aggregations">group window or over window aggregations</a>.</p></td>
</tr>
</tbody>
</table>
@@ -724,7 +742,7 @@ Table result3 = tableEnv.sqlQuery(
Table result4 = tableEnv.sqlQuery(
"SELECT user, " +
" SESSION_START(rowtime, INTERVAL '12' HOUR) AS sStart, " +
- " SESSION_END(rowtime, INTERVAL '12' HOUR) AS snd, " +
+ " SESSION_ROWTIME(rowtime, INTERVAL '12' HOUR) AS snd, " +
" SUM(amount) " +
"FROM Orders " +
"GROUP BY SESSION(rowtime, INTERVAL '12' HOUR), user");