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

Julian Hyde resolved CALCITE-5294.
----------------------------------
    Resolution: Fixed

Fixed in 
[457927ad|https://github.com/apache/calcite/commit/457927ada244618c4752099d8d5d65d6d5fe425f];
 thanks for the PR, [~kkasa]!

> Prune the null-generating side of an outer join if it is empty
> --------------------------------------------------------------
>
>                 Key: CALCITE-5294
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5294
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.33.0
>
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> If a {{Join}} generates null on the right and the right branch of the join 
> known never produces any rows the join can be replaced with the left branch 
> and a project on top of it which contains the expressions come from the left 
> branch and null constants from the right branch. Example:
> {code:java}
> select * from emp e
> left outer join (select * from dept where false) as d on e.deptno = d.deptno
> {code}
> {code:java}
> select 
>   e.*, 
>   cast(null as <dept_col0_type>) as <dept_col0_name>
>   ... 
>   cast(null as <dept_coln_type>) as <dept_coln_name> 
> from emp
> {code}



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

Reply via email to