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

Gian Merlino commented on CALCITE-1719:
---------------------------------------

The rule shouldn't care about the inner sort order at all, it's just looking at 
the limits and offsets. The rule also won't fire if the outer sort has any 
collations associated with it, since in that case, the two sorts aren't in 
general going to be collapsible.

Out of curiosity what do you mean by "it's dangerous to assume that Sort 
produces sorted output"? Surely if a Sort has a collation associated with it 
then it should produce sorted output? If not, then the limit and offset would 
have potentially wrong behavior.

I'll adjust the test.

Is there an IntelliJ code style config I can import that matches the Calcite 
code style? The code passed checkstyle but it sounds like there's some things 
that checkstyle isn't catching.

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

Reply via email to