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

Julian Hyde commented on CALCITE-3221:
--------------------------------------

The description of the case and the commit message should mention Enumerable 
convention and not mention sort. It does not sort; it merges, assuming that the 
input is sorted.

I didn't have time to review the PR in detail, but can you please check the 
following:
* What is the complexity if there is a large number of inputs (say 1000)? (It's 
OK if the complexity isn't good, just say what it is.)
* Suppose you have both a limit and an offset, e.g. {{select * from (select x 
from r union all select x from s) order by x offset 100 limit 10}}. Do you push 
down the offset? I am not sure that that is valid.

> Add a sort-merge union algorithm
> --------------------------------
>
>                 Key: CALCITE-3221
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3221
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.19.0
>            Reporter: Stamatis Zampetakis
>            Assignee: Ruben Q L
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: screenshot-1.png
>
>          Time Spent: 12h
>  Remaining Estimate: 0h
>
> Currently, the union operation offered by CalciteĀ (seeĀ 
> [EnumerableDefaults.union|https://github.com/apache/calcite/blob/d98856bf1a5f5c151d004b769e14bdd368a67234/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java#L2747])
>  "breaks" the collation (if any) of its inputs.
> The goal of this issue is to create a new union algorithm 
> (EnumerableMergeUnion) that, given the fact that its inputs are sorted by the 
> same collation, will return the union / union all result respecting this 
> collation.
> Most likely the implementation of the merge join can be useful.



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

Reply via email to