presto-hive/src/main/java/io/prestosql/plugin/hive/SortingFileWriter.java/SortingFileWriter/appendRows
class SortingFileWriter:    @Override
    public void appendRows(Page page)
    {
        if (!sortBuffer.canAdd(page)) {
            flushToTempFile();
        }
        sortBuffer.add(page);
    }