processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortDataRows.java
/**
   * 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
   *
   * @throws CarbonSortKeyAndGroupByException
   */
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


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
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.getNumberOfNoDictSortColumns() > 0) {
        Arrays.sort(toSort, new NewRowComparator(parameters.getNoDictionarySortColumn()));
      } else {
        Arrays.sort(toSort, new NewRowComparatorForNormalDims(parameters.getNumberOfSortColumns()));
      }
      recordHolderList = toSort;
      String[] tmpLocation = parameters.getTempFileLocation();
      String locationChosen = tmpLocation[new Random().nextInt(tmpLocation.length)];
      File file = new File(
          locationChosen + 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 . getNumberOfNoDictSortColumns ( ) > 0 ) { Arrays . sort ( toSort , new NewRowComparator ( parameters . getNoDictionarySortColumn ( ) ) ) ; } else { Arrays . sort ( toSort , new NewRowComparatorForNormalDims ( parameters . getNumberOfSortColumns ( ) ) ) ; } recordHolderList = toSort ; String [ ] tmpLocation = parameters . getTempFileLocation ( ) ; String locationChosen = tmpLocation [ new Random ( ) . nextInt ( tmpLocation . length ) ] ; File file = new File ( locationChosen + 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
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
// create new file and choose folder randomly