Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion docs/dev/table/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3573,7 +3573,18 @@ NUMERIC.years
<p>Creates an interval of months for <i>NUMERIC</i> years.</p>
</td>
</tr>

<tr>
<td>
{% highlight java %}
NUMERIC.quarter
NUMERIC.quarters
{% endhighlight %}
</td>
<td>
<p>Creates an interval of months for <i>NUMERIC</i> quarters.</p>
<p>E.g., <code>2.quarters</code> returns 6.</p>
</td>
</tr>
<tr>
<td>
{% highlight java %}
Expand All @@ -3586,6 +3597,19 @@ NUMERIC.months
</td>
</tr>

<tr>
<td>
{% highlight java %}
NUMERIC.week
NUMERIC.weeks
{% endhighlight %}
</td>
<td>
<p>Creates an interval of milliseconds for <i>NUMERIC</i> weeks.</p>
<p>E.g., <code>2.weeks</code> returns 1209600000.</p>
</td>
</tr>

<tr>
<td>
{% highlight java %}
Expand Down Expand Up @@ -3831,6 +3855,19 @@ NUMERIC.years
</td>
</tr>

<tr>
<td>
{% highlight scala %}
NUMERIC.quarter
NUMERIC.quarters
{% endhighlight %}
</td>
<td>
<p>Creates an interval of months for <i>NUMERIC</i> quarters.</p>
<p>E.g., <code>2.quarters</code> returns 6.</p>
</td>
</tr>

<tr>
<td>
{% highlight scala %}
Expand All @@ -3843,6 +3880,19 @@ NUMERIC.months
</td>
</tr>

<tr>
<td>
{% highlight scala %}
NUMERIC.week
NUMERIC.weeks
{% endhighlight %}
</td>
<td>
<p>Creates an interval of milliseconds for <i>NUMERIC</i> weeks.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add an example: e.g.:
E.g., 1.weeks returns 604800000 ms.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

<p>E.g., <code>2.weeks</code> returns 1209600000.</p>
</td>
</tr>

<tr>
<td>
{% highlight scala %}
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/table/tableApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Table orders = tEnv.scan("Orders"); // schema (a, b, c, rowtime)

Table result = orders
.filter("a.isNotNull && b.isNotNull && c.isNotNull")
.select("a.lowerCase(), b, rowtime")
.select("a.lowerCase() as a, b, rowtime")
.window(Tumble.over("1.hour").on("rowtime").as("hourlyWindow"))
.groupBy("hourlyWindow, a")
.select("a, hourlyWindow.end as hour, b.avg as avgBillingAmount");
Expand All @@ -128,7 +128,7 @@ val orders: Table = tEnv.scan("Orders") // schema (a, b, c, rowtime)

val result: Table = orders
.filter('a.isNotNull && 'b.isNotNull && 'c.isNotNull)
.select('a.lowerCase(), 'b, 'rowtime)
.select('a.lowerCase() as 'a, 'b, 'rowtime)
.window(Tumble over 1.hour on 'rowtime as 'hourlyWindow)
.groupBy('hourlyWindow, 'a)
.select('a, 'hourlyWindow.end as 'hour, 'b.avg as 'avgBillingAmount)
Expand Down