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

Stamatis Zampetakis commented on CALCITE-4475:
----------------------------------------------

Hey [~rubenql], I think the answer to your question is in the following 
discussions. If I remember well the reason is that the join operator (at 
logical level for instance) is not guaranteed to retain the order so removing 
the sort completely could lead to wrong results.

https://lists.apache.org/thread.html/53b3d2336d59d92f299f1bab9ed1380285598b27df0b78086818f930%40%3Cdev.calcite.apache.org%3E

[https://lists.apache.org/thread.html/9950901d8d68b5f009dfbdb4d408b92fafdc685de43852461c207995%40%3Cdev.calcite.apache.org%3E]

 

> New Sort SEMI/ANTI Join Transpose optimization
> ----------------------------------------------
>
>                 Key: CALCITE-4475
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4475
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Ruben Q L
>            Priority: Major
>
> If I am not mistaken, the optimization that is currently applied by 
> {{SortJoinTransposeRule}} for LEFT and RIGHT joins could also by applied to 
> SEMI / ANTI joins (it would be very similar to the current LEFT join 
> optimization).
> It is proposed to either improve this rule to cover SEMI / ANTI joins or 
> create a new dedicated rule for this matter.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to