Skip to content

Commit 5492884

Browse files
committed
copy when ordering
1 parent 7ddd656 commit 5492884

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ case class Exchange(
110110
shuffled.map(_._2)
111111

112112
case RangePartitioning(sortingExpressions, numPartitions) =>
113-
val rdd = if (sortBasedShuffleOn) {
113+
val rdd = if (sortBasedShuffleOn || newOrdering.nonEmpty) {
114114
child.execute().mapPartitions { iter => iter.map(row => (row.copy(), null))}
115115
} else {
116116
child.execute().mapPartitions { iter =>

0 commit comments

Comments
 (0)