DRILL-8480: Cleanup before finished. 0 out of 1 streams have finished #2897
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.
DRILL-8480: Make Nested Loop Join operator properly process empty batches and batches with new schema
Description
Nested Loop Join operator (
NestedLoopJoinBatch
,NestedLoopJoin
) unproperly handles batch iteration outcomeOK
with 0 records. Drill design of the processing of batches involves 5 states:NONE
(batch can have only 0 records)OK
(batch can have 0+ records)OK_NEW_SCHEMA
(batch can have 0+ records)NOT_YET
(undefined)EMIT
(batch can have 0+ records)The Nested Loop Join operator in some circumstances could receive
OK
outcome with 0 records, and instead of requesting the next batch, the operator stops data processing and returnsNONE
outcome to upstream batches(operators) without freeing resources of underlying batches.Solution
Make the Nested Loop Join operator properly handle
OK
andOK_NEW_SCHEMA
outcomes with 0 records and keep processing untilNONE
andNOT_YET
outcomes are received.Make the Nested Loop Join operator keep processing even if
OK_NEW_SCHEMA
outcome is received, but the schema wasn’t changed(yes, I know it sounds wild, but it’s possible and it is expected behavior).Documentation
Testing
Manual testing with a file from the Jira ticket DRILL-8480