File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
core/src/main/java/org/apache/spark/util/collection/unsafe/sort Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,9 @@ public void insertRecord(
265
265
266
266
public UnsafeSorterIterator getSortedIterator () throws IOException {
267
267
final UnsafeSorterIterator inMemoryIterator = sorter .getSortedIterator ();
268
- if (!spillWriters .isEmpty ()) {
268
+ if (spillWriters .isEmpty ()) {
269
+ return inMemoryIterator ;
270
+ } else {
269
271
final UnsafeSorterSpillMerger spillMerger =
270
272
new UnsafeSorterSpillMerger (recordComparator , prefixComparator );
271
273
for (UnsafeSorterSpillWriter spillWriter : spillWriters ) {
@@ -276,8 +278,6 @@ public UnsafeSorterIterator getSortedIterator() throws IOException {
276
278
spillMerger .addSpill (inMemoryIterator );
277
279
}
278
280
return spillMerger .getSortedIterator ();
279
- } else {
280
- return inMemoryIterator ;
281
281
}
282
282
}
283
283
}
You can’t perform that action at this time.
0 commit comments