You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jess Balint (Jira)" <ji...@apache.org> on 2023/02/07 22:34:01 UTC

[jira] [Closed] (CALCITE-5294) Prune the null-generating side of an outer join if it is empty

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

Jess Balint closed CALCITE-5294.
--------------------------------

Resolved in release 1.33.0 (2023-02-06)

> 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)