[ 
https://issues.apache.org/jira/browse/CALCITE-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benchao Li reopened CALCITE-5201:
---------------------------------

> Improve SemiJoinRule to match Join's right input which is unique for Join keys
> ------------------------------------------------------------------------------
>
>                 Key: CALCITE-5201
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5201
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.30.0
>            Reporter: Benchao Li
>            Assignee: Benchao Li
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.32.0
>
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> As disscussed inĀ CALCITE-5195, the following SQL cannot be transformed to 
> semi join:
> {code:sql}
> select * 
> from emp
> where exists(select * from dept where emp.deptno = dept.deptno and emp.empno 
> = dept.deptno)
> {code}
> Currently {{SemiJoinRule}} requires that right child must be an 
> {{Aggregate}}, however, sometimes it's not, e.g. in 
> [{{RelBuilder}}|https://github.com/apache/calcite/blob/300f5200fe50870da418366613df1cd09921b1b6/core/src/main/java/org/apache/calcite/tools/RelBuilder.java#L2241-L2247],
>  if the group keys are unique, then we'll remove the {{Aggregate}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to