public void merge(UnsafeExternalSorter other) throws IOException {
        other.spill();
        spillWriters.addAll(other.spillWriters);
        // remove them from `spillWriters`, or the files will be deleted in `cleanupResources`.
        other.spillWriters.clear();
        other.cleanupResources();
    }
Merges another UnsafeExternalSorters into this one, the other one will be emptied.
indexr-query-opt/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java