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(planner): consider NULL for binary op in type checker #6043

Merged
merged 2 commits into from
Jun 18, 2022

Conversation

xudong963
Copy link
Member

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

Summary

As the title

Changelog

  • Bug Fix

Related Issues

Fixes #6038

@vercel
Copy link

vercel bot commented Jun 17, 2022

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

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Jun 18, 2022 at 2:26AM (UTC)

@xudong963 xudong963 marked this pull request as draft June 17, 2022 09:19
@mergify
Copy link
Contributor

mergify bot commented Jun 17, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the pr-bugfix this PR patches a bug in codebase label Jun 17, 2022
@xudong963 xudong963 changed the title fix(planner): consider **NULL** in type checker fix(planner): consider NULL in type checker Jun 17, 2022
@sundy-li
Copy link
Member

A test to cover :

set enable_planner_v2 = 1;
create table n( a int null, b int null) ;
insert into n select  if (number % 3, null, number), if (number % 2, null, number) from numbers(10);

select a + b, a and b, a - b, a or b from n;

set enable_planner_v2 = 0;
 select a + b, a and b, a - b, a or b  from n;

@xudong963
Copy link
Member Author

xudong963 commented Jun 17, 2022

All binary operators need to consider NULL, such as BinaryOperator::Plus, BinaryOperator::Minus, and so on. But part of them will be converted to function, so functions also need to consider NULL.
Updated: I noticed Function have processed NULL case 👍

@xudong963 xudong963 marked this pull request as ready for review June 18, 2022 02:20
@xudong963 xudong963 changed the title fix(planner): consider NULL in type checker fix(planner): consider NULL for binary op in type checker Jun 18, 2022
@sundy-li sundy-li merged commit ea6abd9 into databendlabs:main Jun 18, 2022
@xudong963 xudong963 deleted the null branch June 18, 2022 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: schema mismatch in new planner
4 participants