Skip to content

Commit

Permalink
Normalize expression ids in Partial aggregate expressions to fix a re…
Browse files Browse the repository at this point in the history
…gression when running with Spark 3.2 (#3403)

Signed-off-by: Andy Grove <[email protected]>
  • Loading branch information
andygrove authored Sep 9, 2021
1 parent fe243c2 commit de2c1a3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,13 @@ case class GpuAggregateExpression(origAggregateFunction: GpuAggregateFunction,
// We compute the same thing regardless of our final result.
override lazy val canonicalized: Expression = {
val normalizedAggFunc = mode match {
// For PartialMerge or Final mode, the input to the `aggregateFunction` is aggregate buffers,
// and the actual children of `aggregateFunction` is not used, here we normalize the expr id.
case PartialMerge | Final => aggregateFunction.transform {
// For Partial, PartialMerge, or Final mode, the input to the `aggregateFunction` is
// aggregate buffers, and the actual children of `aggregateFunction` is not used,
// here we normalize the expr id.
case Partial | PartialMerge | Final => aggregateFunction.transform {
case a: AttributeReference => a.withExprId(ExprId(0))
}
case Partial | Complete => aggregateFunction
case Complete => aggregateFunction
}

GpuAggregateExpression(
Expand Down

0 comments on commit de2c1a3

Please sign in to comment.