[ https://issues.apache.org/jira/browse/BEAM-2255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16006669#comment-16006669 ]
James Xu commented on BEAM-2255: -------------------------------- Just realised that `limit 10, 5` is implementable by using three nested `Top`: 1. first use Top to fetch (10 + 5) records 2. then use Top to strip the leading 10 records (the sorting order will be reversed) 3. use another Top to reverse the result of step two. > support ORDER BY clause > ----------------------- > > Key: BEAM-2255 > URL: https://issues.apache.org/jira/browse/BEAM-2255 > Project: Beam > Issue Type: New Feature > Components: dsl-sql > Reporter: James Xu > Assignee: James Xu > > Currently Beam does not have `global sort` support[1]. So we will implement a > limited version of `ORDER BY` using `org.apache.beam.sdk.transforms.Top` for > now. So it will support sql like: > {code:sql} > select * from t order by id desc limit 10; > {code} > but not support `ORDER BY` without a `limit`: > {code:sql} > select * from t order by id desc > {code} > and also not support `ORDER BY` with a `offset`: > {code:sql} > select * from t order by id desc limit 10, 10; > {code} > [1]. > https://lists.apache.org/thread.html/bc0e65a3bb653b8fd0db96bcd4c9da5af71a71af5a5639a472167808@1464278191@%3Cdev.beam.apache.org%3E -- This message was sent by Atlassian JIRA (v6.3.15#6346)