Skip to content

Commit 2875ef2

Browse files
committed
fix changed configuration
1 parent 61d7f49 commit 2875ef2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ private[sql] case class AddExchange(sqlContext: SQLContext) extends Rule[SparkPl
177177
rowOrdering: Option[Ordering[Row]] = None): SparkPlan = {
178178
val needSort = child.outputOrdering != rowOrdering
179179
if (child.outputPartitioning != partitioning || needSort) {
180+
// TODO: if only needSort, we need only sort each partition instead of an Exchange
180181
Exchange(partitioning, child, sort = needSort)
181182
} else {
182183
child

sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class JoinSuite extends QueryTest with BeforeAndAfterEach {
6565
cacheManager.clearCache()
6666

6767
val SORTMERGEJOIN_ENABLED: Boolean = conf.sortMergeJoinEnabled
68-
conf.setConf("spark.sql.autoSortMergeJoin", "false")
6968
Seq(
7069
("SELECT * FROM testData LEFT SEMI JOIN testData2 ON key = a", classOf[LeftSemiJoinHash]),
7170
("SELECT * FROM testData LEFT SEMI JOIN testData2", classOf[LeftSemiJoinBNL]),
@@ -96,14 +95,14 @@ class JoinSuite extends QueryTest with BeforeAndAfterEach {
9695
classOf[BroadcastNestedLoopJoin])
9796
).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
9897
try {
99-
conf.setConf("spark.sql.autoSortMergeJoin", "true")
98+
conf.setConf("spark.sql.planner.sortMergeJoin", "true")
10099
Seq(
101100
("SELECT * FROM testData JOIN testData2 ON key = a", classOf[SortMergeJoin]),
102101
("SELECT * FROM testData JOIN testData2 ON key = a and key = 2", classOf[SortMergeJoin]),
103102
("SELECT * FROM testData JOIN testData2 ON key = a where key = 2", classOf[SortMergeJoin])
104103
).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
105104
} finally {
106-
conf.setConf("spark.sql.autoSortMergeJoin", SORTMERGEJOIN_ENABLED.toString)
105+
conf.setConf("spark.sql.planner.sortMergeJoin", SORTMERGEJOIN_ENABLED.toString)
107106
}
108107
}
109108

0 commit comments

Comments
 (0)