Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/1822#discussion_r16007279
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/Aggregate.scala ---
@@ -148,53 +151,121 @@ case class Aggregate(
Iterator(resultProjection(aggregateResults))
}
} else {
- child.execute().mapPartitions { iter =>
- val hashTable = new HashMap[Row, Array[AggregateFunction]]
- val groupingProjection = new
InterpretedMutableProjection(groupingExpressions, childOutput)
+ if (!externalSorting) {
--- End diff --
Instead of doing the if check here, what do you think about this:
- Create a trait called `Aggregate` that contains shared code.
- Create two operators `OnHeapAggregation` and `ExternalAggregation`.
- Choose which one to use in the planner based on the above configuration.
---
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]