cloud-fan commented on a change in pull request #34474:
URL: https://github.com/apache/spark/pull/34474#discussion_r742699003
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/AggregatingAccumulator.scala
##########
@@ -156,6 +156,15 @@ class AggregatingAccumulator private(
case agg: AggregatingAccumulator =>
val buffer = getOrCreateBuffer()
val otherBuffer = agg.buffer
+ // If AggregatingAccumulator runs on driver,
+ // we should deserialize all TypedImperativeAggregate.
+ if (isAtDriverSide) {
Review comment:
We don't need to add a new code. We can just change the existing code
```
while (i < typedImperatives.length) {
typedImperatives(i).mergeBuffersObjects(buffer, otherBuffer)
i += 1
}
```
to
```
if (atDriverSide) {
while (i < typedImperatives.length) {
// The input buffer stores serialized data
typedImperatives(i).merge(buffer, otherBuffer)
i += 1
}
} else {
while (i < typedImperatives.length) {
// The input buffer stores deserialized object
typedImperatives(i). mergeBuffersObjects(buffer, otherBuffer)
i += 1
}
}
```
--
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]