Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/4046#discussion_r120754137
--- Diff: docs/dev/table/sql.md ---
@@ -163,31 +164,257 @@ For a better definition of SQL queries within a Java
String, Flink SQL uses a le
{% top %}
-Example Queries
----------------
+Operations
+--------------------
+
+### Scan, Projection, and Filter
-**TODO: Add a examples for different operations with similar structure as
for the Table API. Add highlighted tags if an operation is not supported by
stream / batch.**
-
-* Scan & Values
-* Selection & Projection
-* Aggregations (distinct only Batch)
- * GroupBy
- * GroupBy Windows (TUMBLE, HOP, SESSION)
- * OVER windows (Only Stream)
- * Grouping sets, rollup, cube (only batch)
- * Having (only batch?)
-* Joins
- * Inner equi joins (only batch)
- * Outer equi joins (only batch)
- * TableFunction
-* Set operations (only batch, except Union ALL)
-* OrderBy + Limit + Offset
+<div markdown="1">
+<table class="table table-bordered">
+ <thead>
+ <tr>
+ <th class="text-left" style="width: 20%">Operators</th>
+ <th class="text-center">Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><strong>Scan / Select / As</strong></td>
+ <td>
+{% highlight sql %}
+SELECT * FROM Orders
+SELECT a, c AS d FROM Orders
+{% endhighlight %}
+ </td>
+ </tr>
+ <tr>
+ <td><strong>Where / Filter</strong></td>
+ <td>
+{% highlight sql %}
+SELECT * FROM Orders WHERE b = 'red'
+SELECT * FROM Orders WHERE a % 2 = 0
+{% endhighlight %}
+ </td>
+ </tr>
+ <tr>
+ <td><strong>User Defined Functions (UDF)</strong></td>
+ <td>
+ <p>SQL queries can refer to UDFs provided that they are registered
in the `TableEnvironment`.</p>
+{% highlight sql %}
+SELECT PRETTY_PRINT(user) FROM Orders
+{% endhighlight %}
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
{% top %}
-### GroupBy Windows
+### Aggregations
-**TODO: Integrate this with the examples**
+<div markdown="1">
+<table class="table table-bordered">
+ <thead>
+ <tr>
+ <th class="text-left" style="width: 20%">Operators</th>
+ <th class="text-center">Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><strong>GroupBy</strong></td>
+ <td>
+{% highlight sql %}
+SELECT a, SUM(b) as d FROM Orders GROUP BY a
+{% endhighlight %}
+ </td>
+ </tr>
+ <tr>
+ <td><strong>GroupBy Window</strong></td>
+ <td>
+ <p>Use a group window to compute a single result row per group.
(See <a href="#group-windows">Group Windows</a> for more details.)</p>
+ {% highlight sql %}
+ SELECT user, SUM(amount) FROM Orders GROUP BY TUMBLE(rowtime,
INTERVAL '1' DAY), user
+ {% endhighlight %}
+ </td>
+ </tr>
+ <tr>
+ <td><strong>Over Window</strong></td>
--- End diff --
Add a brief description that only all aggregates must be defined over the
same window, i.e., we do not support aggregates over different windows.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---