[
https://issues.apache.org/jira/browse/CALCITE-1719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15937109#comment-15937109
]
Julian Hyde commented on CALCITE-1719:
--------------------------------------
An implementation of Sort is at liberty to sort the data, apply the limit, and
then scramble the data. (Behavior is different at the root RelNode of the
tree.) Or bucket the data into multiple parallel streams. Or whatever. So, if
you need a particular sort order (as CALCITE-853 would, for example) then
should should rely on collations. That would make the rule safer, and more
widely applicable (say to a Sort on a Filter on a Sort).
It sounds like you are not relying on output order, so we're good.
Checkstyle can't express everything. (Maybe Intellij can, but we don't require
contributors to use Intellij.) So the standard has to be "follow the existing
style".
> SortCollapseRule for collapsing nested sorts
> --------------------------------------------
>
> Key: CALCITE-1719
> URL: https://issues.apache.org/jira/browse/CALCITE-1719
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Gian Merlino
> Assignee: Julian Hyde
>
> Useful for subqueries like {{SELECT * FROM (...) LIMIT X}}, where the inner
> query might have an order by or limit.
> Patch in https://github.com/apache/calcite/pull/410.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)