maropu commented on a change in pull request #31353:
URL: https://github.com/apache/spark/pull/31353#discussion_r566069710
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectAggregationIterator.scala
##########
@@ -158,7 +158,7 @@ class ObjectAggregationIterator(
processRow(buffer, newInput)
// The hash map gets too large, makes a sorted spill and clear the map.
- if (hashMap.size >= fallbackCountThreshold) {
+ if (hashMap.size >= fallbackCountThreshold && inputRows.hasNext) {
Review comment:
Ah, ok. I've checked the code and the fix looks reasonable.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]