-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix incorrect NULL IN () optimization
#17092
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 incorrect NULL IN () optimization
#17092
Conversation
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @findepi
It is unfortunate that we need to complicate the actual code to add a testing hook.
Is it posisble to just unit test the code in question -- for example, perhaps we could write a unit test that usedSimplifier directly rather than ExprSimplifier 🤔
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs
Outdated
Show resolved
Hide resolved
One can argue that one is an impl detail of the other... are there any tests for
we can go without a regression test for this fix. |
The optimization does not manifest as a bug in typical queries, because the `ConstantEvaluator` prevents that. However, it still needs to be corrected (or removed), otherwise it's a bug waiting to manifest somewhere.
done |
7727b4c to
0a7b3a9
Compare
xudong963
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @findepi
| assert_eq!(simplify(expr), lit(true)); | ||
| } | ||
|
|
||
| #[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
The optimization does not manifest as a bug in typical queries, because
the
ConstantEvaluatorprevents that. However, it still needs to becorrected (or removed), otherwise it's a bug waiting to manifest
somewhere.