presto-hive/src/main/java/io/prestosql/plugin/hive/SortingFileWriter.java/SortingFileWriter/writeSorted
class SortingFileWriter:    private void writeSorted()
    {
        combineFiles();

        mergeFiles(tempFiles, outputWriter::appendRows);
    }