Repository navigation
Fix IN subqueries that return a NULL in the multi-stage engine - #20383
Open
Indian-boult wants to merge 1 commit into
Open
Indian-boult wants to merge 1 commit into
Indian-boult wants to merge 1 commit into
Conversation
The dynamic broadcast semi join turns the keys of its right side into an IN filter on the left leaf stage. A null key made computeInOperands throw while it unboxed or sorted the keys, so an IN subquery failed whenever the subquery returned a null under null handling. A null key never matches, so it is now left out of the IN list, and a right side with only null keys gives a constant false filter. Fixes apache#20382
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #20383 +/- ##
============================================
- Coverage 61.23% 61.21% -0.02%
Complexity 1 1
============================================
Files 2793 2793
Lines 180530 180544 +14
Branches 30232 30237 +5
============================================
- Hits 110556 110529 -27
- Misses 60642 60662 +20
- Partials 9332 9353 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20382
computeInOperandsinServerPlanRequestUtilsnow skips null keys before it builds and sorts the IN list, because a null key never matches in a semi join. When no non-null key is left,attachDynamicFilteruses a constant false filter, as it already did for an empty right side.I added a
semi_join_null_keyscase toSemiJoins.jsonwith nine queries, one per key type plus two subqueries that return only nulls, all with null handling on. On master all nine fail with the errors in the issue. With the change the fullResourceBasedQueriesTestpasses. Spotless, checkstyle and license checks pass on pinot-query-runtime.