bersprockets commented on code in PR #44099:
URL: https://github.com/apache/spark/pull/44099#discussion_r1411406390
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/aggregate/DeclarativeAggregateEvaluator.scala:
##########
@@ -17,24 +17,24 @@
package org.apache.spark.sql.catalyst.expressions.aggregate
import org.apache.spark.sql.catalyst.InternalRow
-import org.apache.spark.sql.catalyst.expressions.{Attribute, JoinedRow,
SafeProjection}
Review Comment:
`SafeProjection` works fine until the aggregation buffer contains more than
one field. In that case, if the second expression in the function's
`updateExpressions` looks back at the buffer's first field, that first field
may have already been changed by the first expression.
`MutableProjection`, on the other hand, keeps an intermediate results row,
so the current buffer is not affected until all expressions in
`updateExpressions` have been evaluated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]