Skip to content

Commit

Permalink
fix changed configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-wang committed Apr 12, 2015
1 parent 61d7f49 commit 2875ef2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ private[sql] case class AddExchange(sqlContext: SQLContext) extends Rule[SparkPl
rowOrdering: Option[Ordering[Row]] = None): SparkPlan = {
val needSort = child.outputOrdering != rowOrdering
if (child.outputPartitioning != partitioning || needSort) {
// TODO: if only needSort, we need only sort each partition instead of an Exchange
Exchange(partitioning, child, sort = needSort)
} else {
child
Expand Down
5 changes: 2 additions & 3 deletions sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class JoinSuite extends QueryTest with BeforeAndAfterEach {
cacheManager.clearCache()

val SORTMERGEJOIN_ENABLED: Boolean = conf.sortMergeJoinEnabled
conf.setConf("spark.sql.autoSortMergeJoin", "false")
Seq(
("SELECT * FROM testData LEFT SEMI JOIN testData2 ON key = a", classOf[LeftSemiJoinHash]),
("SELECT * FROM testData LEFT SEMI JOIN testData2", classOf[LeftSemiJoinBNL]),
Expand Down Expand Up @@ -96,14 +95,14 @@ class JoinSuite extends QueryTest with BeforeAndAfterEach {
classOf[BroadcastNestedLoopJoin])
).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
try {
conf.setConf("spark.sql.autoSortMergeJoin", "true")
conf.setConf("spark.sql.planner.sortMergeJoin", "true")
Seq(
("SELECT * FROM testData JOIN testData2 ON key = a", classOf[SortMergeJoin]),
("SELECT * FROM testData JOIN testData2 ON key = a and key = 2", classOf[SortMergeJoin]),
("SELECT * FROM testData JOIN testData2 ON key = a where key = 2", classOf[SortMergeJoin])
).foreach { case (query, joinClass) => assertJoin(query, joinClass) }
} finally {
conf.setConf("spark.sql.autoSortMergeJoin", SORTMERGEJOIN_ENABLED.toString)
conf.setConf("spark.sql.planner.sortMergeJoin", SORTMERGEJOIN_ENABLED.toString)
}
}

Expand Down

0 comments on commit 2875ef2

Please sign in to comment.