Skip to content

Commit

Permalink
refactor: Simplify the partial full handling for distinct aggregation (
Browse files Browse the repository at this point in the history
…facebookincubator#11876)

Summary:

The current partial full is cleared when there is no new distinct in add input if it has been set.
The reason for doing this is to avoid distinct partial aggregation hanging problem
as we only reset the grouping set in case of partial full if there is new distinct found in get output.
This is a bit tricky and it is better to handle reset partial full unconditionally in get output for
distinct type of aggregation.

Differential Revision: D67288365
  • Loading branch information
xiaoxmeng authored and facebook-github-bot committed Dec 17, 2024
1 parent e937db3 commit 60d9362
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions velox/exec/HashAggregation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,9 @@ void HashAggregation::addInput(RowVectorPtr input) {
// Save input to use for output in getOutput().
input_ = input;
} else {
// If no new distinct groups (meaning we don't have anything to output),
// then we need to ensure we 'need input'. For that we need to reset
// the 'partial full' flag.
partialFull_ = false;
VELOX_CHECK(
!partialFull_,
"Unexpected partial full when there is no new distincts");
}
}
}
Expand Down

0 comments on commit 60d9362

Please sign in to comment.