Skip to content

Commit 827c320

Browse files
committed
One more comment fix
1 parent 028e1b0 commit 827c320

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ private[spark] class ExternalSorter[K, V, C](
364364
: Iterator[Product2[K, C]] = {
365365
val bufferedIters = iterators.filter(_.hasNext).map(_.buffered)
366366
type Iter = BufferedIterator[Product2[K, C]]
367+
// Use the reverse order (compare(y,x)) because PriorityQueue dequeues the max
367368
val heap = new mutable.PriorityQueue[Iter]()(
368369
(x: Iter, y: Iter) => comparator.compare(y.head._1, x.head._1))
369370
heap.enqueue(bufferedIters: _*) // Will contain only the iterators with hasNext = true

0 commit comments

Comments
 (0)