You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/08/02 14:57:20 UTC

[jira] [Commented] (FLINK-3940) Add support for ORDER BY OFFSET FETCH

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

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

Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2282#discussion_r73171110
  
    --- 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 --
    
    If `fetch` can only be used after a `offset`. Wouldn't it be better to overload `offset`? We could also call it `limit` (with one and two parameters) similar to `RelBuilder` does it.


> 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)