Github user kumarvishal09 commented on the issue: https://github.com/apache/carbondata/pull/3029 @NamanRastogi You can merge HybridSorter into CompactionResultSortProcessor. For unsorted file it will be same flow, for sorted file you add one adapter(InMemorySortTempFileChunkHolder) on top of RawResultIterator which will be inline with SortTempFileChunkHolder class so Interface will be same. And In SingleThreadFinalMerger expose one method which will take List of Sorted RawResultIterator and add to record holder heap(PrirotyQueue). InMemorySortTempFileChunkHolder you have to convert Object[] to IntermediateSortTempRow in getRowMethod
---