Skip to content

Commit

Permalink
Optimize rowConstructNeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 committed Nov 1, 2023
1 parent c33cf37 commit b00dfdd
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,13 @@ case class HashAggregateExecTransformer(
// Return whether the outputs partial aggregation should be combined for Velox computing.
// When the partial outputs are multiple-column, row construct is needed.
private def rowConstructNeeded: Boolean = {
for (aggregateExpression <- aggregateExpressions) {
aggregateExpression.mode match {
aggregateExpressions.exists { aggExpr =>
aggExpr.mode match {
case PartialMerge | Final =>
if (aggregateExpression.aggregateFunction.inputAggBufferAttributes.size > 1) {
return true
}
case _ =>
aggExpr.aggregateFunction.inputAggBufferAttributes.size > 1
case _ => false
}
}
false
}

// Return a scalar function node representing row construct function in Velox.
Expand Down

0 comments on commit b00dfdd

Please sign in to comment.