Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/8038#discussion_r36684365
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/TungstenAggregationIterator.scala
---
@@ -426,6 +426,10 @@ class TungstenAggregationIterator(
case _ => false
}
+ // Note: we spill the sorter's contents immediately after creating it.
Therefore, we must
+ // insert something into the sorter here to ensure that we acquire at
least a page of memory.
+ // Otherwise, children operators may steal the window of opportunity
and starve our sorter.
+
--- End diff --
How about we explicitly say that `externalSorter.insertKV(firstKey,
buffer)` will trigger the page allocation?
---
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]