Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
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:
select * from emp e left outer join (select * from dept where false) as d on e.deptno = d.deptno
select e.*, cast(null as <dept_col0_type>) as <dept_col0_name> ... cast(null as <dept_coln_type>) as <dept_coln_name> from emp
Attachments
Issue Links
- relates to
-
CALCITE-5282 JdbcValues should add CAST on NULL values
- Open
- links to