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

Ruben Q L commented on CALCITE-3285:
------------------------------------

Could we please re-consider merging 
[PR#1788|https://github.com/apache/calcite/pull/1788] in order to have a 
pragmatic solution for this issue in the short term?
 To sum up, this fix proposes having a predicate with the non-equi clauses of 
the join condition (which will be null in case of equi joins).
 Pros:
 - Full support of all types of conditions in MergeJoin (equi and non-equi), 
which is the goal of the current ticket.
 - No regression for equi-joins (they will behave as before, so we should see 
no performance regression in there).
 - It allows future work on the MergeJoin in order to support other join types 
(right now only INNER join is supported). In this regard, right now this ticket 
is blocking some other improvements in the MergeJoin that I would like to 
include in the short term (CALCITE-3833 _Support SemiJoin_ and CALCITE-3834 
_Support AntiJoin_). The other discussed approach to solve the current ticket, 
based on splitting the join into "mergeJoin(equiCondition) + 
where(nonEquiCondition)", only works for INNER joins, so it would be able to 
support CALCITE-3833 and CALCITE-3834.

I understand [~vladimirsitnikov] concerns regarding future work on optimizing 
MergeJoin algorithm, but as I see it, introducing
 a Predicate with the non-optimizable clause(s) from the MergeJoin condition 
(as [PR#1788|https://github.com/apache/calcite/pull/1788] proposes) is 
something IMHO unavoidable in order to handle all type of (non-equi) 
conditions, as I described on my previous comment.

> EnumerableMergeJoin should support non-equi join conditions
> -----------------------------------------------------------
>
>                 Key: CALCITE-3285
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3285
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Haisheng Yuan
>            Assignee: Vladimir Sitnikov
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> Calcite should be able to generate EnumerableMergeJoin with non-equi join 
> conditions, as long as there are equi-join conditions.



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

Reply via email to