-
Notifications
You must be signed in to change notification settings - Fork 435
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
[GLUTEN-5682][VL] Fix incorrect result when isNull & isNotNull coexist in filter #5670
Conversation
Thanks for opening a pull request! Could you open an issue for this pull request on Github Issues? https://github.com/apache/incubator-gluten/issues Then could you also rename commit message and pull request title in the following format?
See also: |
Is it only a Spark UT issue? or observed in some SQL? |
velox related change has been merged via facebookincubator/velox#9718 |
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.
Thanks for your fix! Just one comment. Thanks!
@@ -375,6 +377,8 @@ class SubstraitToVeloxPlanConverter { | |||
|
|||
bool nullAllowed_ = false; | |||
bool isNull_ = false; | |||
bool forbidsNullSet_ = false; | |||
bool isNullSet_ = false; |
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.
Is forbidsNullSet_
logically equivalent to !nullAllowed
? And isNullSet_
equivalent to isNull_
? If true, we can just use the existing flags (maybe, should also check initialized_ == true
?). Thanks!
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.
Actually not. initialized_ can be set other place not just here two null related setter method.
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.
Actually not. initialized_ can be set other place not just here two null related setter method.
So we can not according to initialized_
variable to determine whether setNull()
or forbidsNull()
has been called first.
And now setNull
method will set nullAllowed_ to true that could cause unexpected filter behavior.
IMO, forbidsNullSet_
and isNullSet_
make code more clean and readable without other performance cost.
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.
Looks good! Thanks!
What changes were proposed in this pull request?
Fix the bug founded in issue (Fixes: #5682)
How was this patch tested?
Add ut to cover the change!