Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer committed Jan 19, 2024
1 parent 2607ff6 commit 43fb07b
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@ object FlushableHashAggregateRule {
* perform optimizations like doing "partial_count(a, b, c)" directly on the output data.
*/
def isAggInputAlreadyDistributedWithAggKeys(agg: HashAggregateExecTransformer): Boolean = {
val distribution = if (agg.groupingExpressions.isEmpty) {
UnspecifiedDistribution
} else {
ClusteredDistribution(agg.groupingExpressions)
if (agg.groupingExpressions.isEmpty) {
// Empty grouping set () should not be satisfied by any partitioning patterns.
// E.g.,
// (a, b) satisfies (a, b, c)
// (a, b) satisfies (a, b)
// (a, b) doesn't satisfy (a)
// (a, b) doesn't satisfy ()
return false
}
val distribution = ClusteredDistribution(agg.groupingExpressions)
agg.child.outputPartitioning.satisfies(distribution)
}
}

0 comments on commit 43fb07b

Please sign in to comment.