public void startSorting() throws CarbonSortKeyAndGroupByException {
  LOGGER.info("File based sorting will be used");
  if (this.entryCount > 0) {
    Object[][] toSort;
    toSort=new Object[entryCount][];
    System.arraycopy(recordHolderList,0,toSort,0,entryCount);
    if (parameters.getNoDictionaryCount() > 0) {
      Arrays.sort(toSort,new RowComparator(parameters.getNoDictionaryDimnesionColumn(),parameters.getNoDictionaryCount()));
    }
 else {
      Arrays.sort(toSort,new RowComparatorForNormalDims(parameters.getDimColCount()));
    }
    recordHolderList=toSort;
    File file=new File(parameters.getTempFileLocation() + File.separator + parameters.getTableName()+ System.nanoTime()+ CarbonCommonConstants.SORT_TEMP_FILE_EXT);
    writeDataTofile(recordHolderList,this.entryCount,file);
  }
  startFileBasedMerge();
  this.recordHolderList=null;
}

public void startSorting ( ) throws CarbonSortKeyAndGroupByException { LOGGER . info ( "File based sorting will be used" ) ; if ( this . entryCount > 0 ) { Object [ ] [ ] toSort ; toSort = new Object [ entryCount ] [ ] ; System . arraycopy ( recordHolderList , 0 , toSort , 0 , entryCount ) ; if ( parameters . getNoDictionaryCount ( ) > 0 ) { Arrays . sort ( toSort , new RowComparator ( parameters . getNoDictionaryDimnesionColumn ( ) , parameters . getNoDictionaryCount ( ) ) ) ; } else { Arrays . sort ( toSort , new RowComparatorForNormalDims ( parameters . getDimColCount ( ) ) ) ; } recordHolderList = toSort ; File file = new File ( parameters . getTempFileLocation ( ) + File . separator + parameters . getTableName ( ) + System . nanoTime ( ) + CarbonCommonConstants . SORT_TEMP_FILE_EXT ) ; writeDataTofile ( recordHolderList , this . entryCount , file ) ; } startFileBasedMerge ( ) ; this . recordHolderList = null ; }
below method will be used to start storing process this method will get all the temp files present in sort temp folder then it will create the record holder heap and then it will read first record from each file and initialize the heap
