-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Bug](set) avoid empty string equal with null on set operator #60062
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
base: master
Are you sure you want to change the base?
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
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.
Pull request overview
This pull request fixes a bug where set operators (EXCEPT, INTERSECT, UNION) incorrectly treated empty strings as NULL values when processing nullable string columns. The fix introduces support for nullable string keys in hash tables used by set operators.
Changes:
- Added
SetMethodOneStringNullabletype definition for handling nullable string columns with proper NULL key handling - Updated
SetHashTableVariantsto include the new nullable string method variant - Modified
SetDataVariants::init()to conditionally select nullable vs non-nullable string methods based on column nullability - Added regression test case to verify the fix works correctly
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
be/src/pipeline/common/set_utils.h |
Added nullable string hash table method and conditional logic for string key selection |
regression-test/suites/query_p0/set/rqg_prod_20240226/rqg_prod_20240226.groovy |
Test suite definition with table creation and query execution |
regression-test/suites/query_p0/set/rqg_prod_20240226/data |
Test data insert statements for the tables |
regression-test/data/query_p0/set/rqg_prod_20240226/rqg_prod_20240226.out |
Expected output file for the regression test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
regression-test/suites/query_p0/set/rqg_prod_20240226/rqg_prod_20240226.groovy
Show resolved
Hide resolved
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
What problem does this PR solve?
This pull request extends the set utilities in the pipeline to support nullable string keys in hash tables. The main changes involve introducing a new method for handling nullable string columns, updating the variant types to include this method, and adjusting the logic for selecting the appropriate method based on nullability. Additionally, a new regression test output file has been added.
Enhancements to set utilities for nullable string support:
SetMethodOneStringNullablefor handling nullable string columns, usingMethodSingleNullableColumnwith aDataWithNullKeywrapper.SetHashTableVariantstype to include the newSetMethodOneStringNullablevariant.SetDataVariantsstruct to selectSetMethodOneStringNullablewhen the string key is nullable, otherwise defaulting to the non-nullable version.Testing:
regression-test/data/query_p0/set/rqg_prod_20240226/rqg_prod_20240226.outto cover the new functionality.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)