Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-8160][SQL]Support using external sorting to run aggregate #6875

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private[spark] object SQLConf {
// considered hints and may be ignored by future versions of Spark SQL.
val EXTERNAL_SORT = "spark.sql.planner.externalSort"
val SORTMERGE_JOIN = "spark.sql.planner.sortMergeJoin"
val SORTMERGE_AGGREGATE = "spark.sql.planner.sortMergeAggregate"

// This is only used for the thriftserver
val THRIFTSERVER_POOL = "spark.sql.thriftserver.scheduler.pool"
Expand Down Expand Up @@ -170,6 +171,14 @@ private[sql] class SQLConf extends Serializable with CatalystConf {
*/
private[spark] def sortMergeJoinEnabled: Boolean = getConf(SORTMERGE_JOIN, "false").toBoolean

/**
* Sort merge aggregate would sort the group key first, then iterate a group to get aggregation,
* then move to next group. Using sort merge aggregate can save a lot of memory usage compared
* to HashAggregate.
*/
private[spark] def sortMergeAggregateEnabled: Boolean =
getConf(SORTMERGE_AGGREGATE, "false").toBoolean

/**
* When set to true, Spark SQL will use the Janino at runtime to generate custom bytecode
* that evaluates expressions found in queries. In general this custom code runs much faster
Expand Down
Loading