[ https://issues.apache.org/jira/browse/FLINK-3940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15405428#comment-15405428 ]
ASF GitHub Bot commented on FLINK-3940: --------------------------------------- Github user gallenvara commented on a diff in the pull request: https://github.com/apache/flink/pull/2282#discussion_r73287941 --- Diff: docs/apis/table.md --- @@ -606,6 +606,28 @@ Table result = in.orderBy("a.asc"); </td> </tr> + <tr> + <td><strong>Offset</strong></td> + <td> + <p>Similar to a SQL OFFSET clause. Returns rows from offset position. It is technically part of the ORDER BY clause.</p> +{% highlight java %} +Table in = tableEnv.fromDataSet(ds, "a, b, c"); +Table result = in.orderBy("a.asc").offset(3); +{% endhighlight %} + </td> + </tr> + + <tr> + <td><strong>Fetch</strong></td> + <td> + <p>Similar to a SQL FETCH clause. Returns a set number of rows. FETCH can’t be used by itself, it is used in conjunction with OFFSET.</p> --- End diff -- Overloading `offset` by setting two parameters like `in.orderBy("a.asc").offset(3, 5)` is a little confusing for users. IMO, `offset` and `fetch` operator should be separated. And it's a logical rule of `sql` that `fetch` should follow with `offset` operator. > Add support for ORDER BY OFFSET FETCH > ------------------------------------- > > Key: FLINK-3940 > URL: https://issues.apache.org/jira/browse/FLINK-3940 > Project: Flink > Issue Type: New Feature > Components: Table API & SQL > Affects Versions: 1.1.0 > Reporter: Fabian Hueske > Assignee: GaoLun > Priority: Minor > > Currently only ORDER BY without OFFSET and FETCH are supported. > This issue tracks the effort to add support for OFFSET and FETCH and involves: > - Implementing the execution strategy in `DataSetSort` > - adapting the `DataSetSortRule` to support OFFSET and FETCH > - extending the Table API and validation to support OFFSET and FETCH and > generate a corresponding RelNode. -- This message was sent by Atlassian JIRA (v6.3.4#6332)