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:

We should have the case in aggregation add input that the partial aggregation has been marked as full
but there is no new distinct detected for a distinct aggregation operator. Instead of clearing the partial
full flag, we should add a distinct check there instead for simplicity.

Differential Revision: D67288365
  • Loading branch information
xiaoxmeng authored and facebook-github-bot committed Dec 17, 2024
1 parent e937db3 commit 108cc0b
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 108cc0b

Please sign in to comment.