You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by twalthr <gi...@git.apache.org> on 2016/08/02 14:56:40 UTC

[GitHub] flink pull request #2282: [FLINK-3940] [table] Add support for ORDER BY OFFS...

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\u2019t 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.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---