Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9038#discussion_r41581748
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/TungstenAggregationIterator.scala
 ---
    @@ -187,72 +266,124 @@ class TungstenAggregationIterator(
         aggregationMode match {
           // Partial-only
           case (Some(Partial), None) =>
    -        val updateExpressions = 
allAggregateFunctions.flatMap(_.updateExpressions)
    -        val updateProjection =
    +        val updateExpressions = allAggregateFunctions.flatMap {
    +          case ae: DeclarativeAggregate => ae.updateExpressions
    +          case agg: AggregateFunction2 => 
Seq.fill(agg.aggBufferAttributes.length)(NoOp)
    +        }
    +        val imperativeAggregateFunctions: Array[ImperativeAggregate] =
    --- End diff --
    
    While `imperativeAggregateFunctions` can't as easily be defined at the top 
of the class (since it would need to be reset when switching to spilling), I 
think that I _could_ lift it out of this `match` statement and put it at the 
top of this function to cut down on code duplication a bit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to