Skip to content

Commit 269089a

Browse files
committed
Avoid unnecessary copy in SQL Exchange
1 parent 34e526e commit 269089a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,7 @@ case class Exchange(
8181
shuffleManager.isInstanceOf[UnsafeShuffleManager]
8282
val bypassMergeThreshold = conf.getInt("spark.shuffle.sort.bypassMergeThreshold", 200)
8383
val serializeMapOutputs = conf.getBoolean("spark.shuffle.sort.serializeMapOutputs", true)
84-
if (newOrdering.nonEmpty) {
85-
// If a new ordering is required, then records will be sorted with Spark's `ExternalSorter`,
86-
// which requires a defensive copy.
87-
true
88-
} else if (sortBasedShuffleOn) {
84+
if (sortBasedShuffleOn) {
8985
val bypassIsSupported = SparkEnv.get.shuffleManager.isInstanceOf[SortShuffleManager]
9086
if (bypassIsSupported && partitioner.numPartitions <= bypassMergeThreshold) {
9187
// If we're using the original SortShuffleManager and the number of output partitions is

0 commit comments

Comments
 (0)