Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable outer join to inner join optimization #9943

Merged
merged 3 commits into from
Feb 11, 2023

Conversation

xudong963
Copy link
Member

@xudong963 xudong963 commented Feb 9, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Background

This SQL is an example: SELECT t1.c0boolean, t0.c0varchar FROM t0 NATURAL LEFT JOIN t1 where t1.c0boolean

Originally a left join, the column logical type of t1 is converted to nullable at the binder stage.

But if outer join -> inner join. where condition will be pushed down. However, the physical type of t1's column is not nullable. This results in a type mismatch.

(Note also that t1 may have been of type c0boolean when the table was created)

Closes #9925

@vercel
Copy link

vercel bot commented Feb 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
databend ⬜️ Ignored (Inspect) Feb 10, 2023 at 6:39AM (UTC)

@xudong963 xudong963 marked this pull request as draft February 9, 2023 08:18
@mergify mergify bot added the pr-bugfix this PR patches a bug in codebase label Feb 9, 2023
@xudong963 xudong963 changed the title fix: reopen outer join to inner join optimization fix: enable outer join to inner join optimization Feb 10, 2023
@xudong963 xudong963 marked this pull request as ready for review February 10, 2023 06:51
@BohuTANG BohuTANG merged commit 46758ce into databendlabs:main Feb 11, 2023
@xudong963 xudong963 deleted the enable_outer_join_to_inner_join branch February 11, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reopen outer join to inner join optimization
3 participants