You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/09/21 13:35:00 UTC
[jira] [Updated] (CALCITE-5294) Improve PruneEmptyRules join instances to remove join if generates null and one branch is empty
[ https://issues.apache.org/jira/browse/CALCITE-5294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated CALCITE-5294:
------------------------------------
Labels: pull-request-available (was: )
> Improve PruneEmptyRules join instances to remove join if generates null and one branch 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
> Time Spent: 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)