core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMap.java
/**
   * Load information for the block.It is the case can happen only for old stores
   * where blocklet information is not available in index file. So load only block information
   * and read blocklet information in executor.
   */
Load information for the block.It is the case can happen only for old stores
where blocklet information is not available in index file. So load only block information
and read blocklet information in executor.
Load information for the block . It is the case can happen only for old stores where blocklet information is not available in index file . So load only block information and read blocklet information in executor .
private DataMapRowImpl loadToUnsafeBlock(DataFileFooter fileFooter,
      SegmentProperties segmentProperties, String filePath, DataMapRowImpl summaryRow,
      BlockMetaInfo blockMetaInfo) {
    int[] minMaxLen = segmentProperties.getColumnsValueSize();
    BlockletIndex blockletIndex = fileFooter.getBlockletIndex();
    CarbonRowSchema[] schema = unsafeMemoryDMStore.getSchema();
    if (summaryRow == null) {
      summaryRow = new DataMapRowImpl(unsafeMemorySummaryDMStore.getSchema());
    }
    DataMapRow row = new DataMapRowImpl(schema);
    int ordinal = 0;
    int taskMinMaxOrdinal = 0;
    row.setByteArray(blockletIndex.getBtreeIndex().getStartKey(), ordinal++);
    BlockletMinMaxIndex minMaxIndex = blockletIndex.getMinMaxIndex();
    byte[][] minValues = updateMinValues(minMaxIndex.getMinValues(), minMaxLen);
    byte[][] maxValues = updateMaxValues(minMaxIndex.getMaxValues(), minMaxLen);
    byte[][] updatedMinValues =
        CarbonUtil.updateMinMaxValues(fileFooter, maxValues, minValues, true);
    byte[][] updatedMaxValues =
        CarbonUtil.updateMinMaxValues(fileFooter, maxValues, minValues, false);
    row.setRow(addMinMax(minMaxLen, schema[ordinal], updatedMinValues), ordinal);
    addTaskMinMaxValues(summaryRow, minMaxLen,
        unsafeMemorySummaryDMStore.getSchema()[taskMinMaxOrdinal], updatedMinValues,
        TASK_MIN_VALUES_INDEX, true);
    ordinal++;
    taskMinMaxOrdinal++;
    row.setRow(addMinMax(minMaxLen, schema[ordinal], updatedMaxValues), ordinal);
    addTaskMinMaxValues(summaryRow, minMaxLen,
        unsafeMemorySummaryDMStore.getSchema()[taskMinMaxOrdinal], updatedMaxValues,
        TASK_MAX_VALUES_INDEX, false);
    ordinal++;
    row.setInt((int)fileFooter.getNumberOfRows(), ordinal++);
    byte[] filePathBytes = filePath.getBytes(CarbonCommonConstants.DEFAULT_CHARSET_CLASS);
    row.setByteArray(filePathBytes, ordinal++);
    row.setShort((short) 0, ordinal++);
    row.setShort(fileFooter.getVersionId().number(), ordinal++);
    row.setLong(fileFooter.getSchemaUpdatedTimeStamp(), ordinal++);
    row.setByteArray(new byte[0], ordinal++);
    row.setLong(fileFooter.getBlockInfo().getTableBlockInfo().getBlockOffset(), ordinal++);
    try {
      setLocations(blockMetaInfo.getLocationInfo(), row, ordinal);
      ordinal++;
      row.setShort((short) -1, ordinal++);
      row.setLong(blockMetaInfo.getSize(), ordinal);
      unsafeMemoryDMStore.addIndexRowToUnsafe(row);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    return summaryRow;
  }
private DataMapRowImpl loadToUnsafeBlock ( DataFileFooter fileFooter , SegmentProperties segmentProperties , String filePath , DataMapRowImpl summaryRow , BlockMetaInfo blockMetaInfo ) { int [ ] minMaxLen = segmentProperties . getColumnsValueSize ( ) ; BlockletIndex blockletIndex = fileFooter . getBlockletIndex ( ) ; CarbonRowSchema [ ] schema = unsafeMemoryDMStore . getSchema ( ) ; if ( summaryRow == null ) { summaryRow = new DataMapRowImpl ( unsafeMemorySummaryDMStore . getSchema ( ) ) ; } DataMapRow row = new DataMapRowImpl ( schema ) ; int ordinal = 0 ; int taskMinMaxOrdinal = 0 ; row . setByteArray ( blockletIndex . getBtreeIndex ( ) . getStartKey ( ) , ordinal ++ ) ; BlockletMinMaxIndex minMaxIndex = blockletIndex . getMinMaxIndex ( ) ; byte [ ] [ ] minValues = updateMinValues ( minMaxIndex . getMinValues ( ) , minMaxLen ) ; byte [ ] [ ] maxValues = updateMaxValues ( minMaxIndex . getMaxValues ( ) , minMaxLen ) ; byte [ ] [ ] updatedMinValues = CarbonUtil . updateMinMaxValues ( fileFooter , maxValues , minValues , true ) ; byte [ ] [ ] updatedMaxValues = CarbonUtil . updateMinMaxValues ( fileFooter , maxValues , minValues , false ) ; row . setRow ( addMinMax ( minMaxLen , schema [ ordinal ] , updatedMinValues ) , ordinal ) ; addTaskMinMaxValues ( summaryRow , minMaxLen , unsafeMemorySummaryDMStore . getSchema ( ) [ taskMinMaxOrdinal ] , updatedMinValues , TASK_MIN_VALUES_INDEX , true ) ; ordinal ++ ; taskMinMaxOrdinal ++ ; row . setRow ( addMinMax ( minMaxLen , schema [ ordinal ] , updatedMaxValues ) , ordinal ) ; addTaskMinMaxValues ( summaryRow , minMaxLen , unsafeMemorySummaryDMStore . getSchema ( ) [ taskMinMaxOrdinal ] , updatedMaxValues , TASK_MAX_VALUES_INDEX , false ) ; ordinal ++ ; row . setInt ( ( int ) fileFooter . getNumberOfRows ( ) , ordinal ++ ) ; byte [ ] filePathBytes = filePath . getBytes ( CarbonCommonConstants . DEFAULT_CHARSET_CLASS ) ; row . setByteArray ( filePathBytes , ordinal ++ ) ; row . setShort ( ( short ) 0 , ordinal ++ ) ; row . setShort ( fileFooter . getVersionId ( ) . number ( ) , ordinal ++ ) ; row . setLong ( fileFooter . getSchemaUpdatedTimeStamp ( ) , ordinal ++ ) ; row . setByteArray ( new byte [ 0 ] , ordinal ++ ) ; row . setLong ( fileFooter . getBlockInfo ( ) . getTableBlockInfo ( ) . getBlockOffset ( ) , ordinal ++ ) ; try { setLocations ( blockMetaInfo . getLocationInfo ( ) , row , ordinal ) ; ordinal ++ ; row . setShort ( ( short ) - 1 , ordinal ++ ) ; row . setLong ( blockMetaInfo . getSize ( ) , ordinal ) ; unsafeMemoryDMStore . addIndexRowToUnsafe ( row ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } return summaryRow ; }
Load information for the block.It is the case can happen only for old stores
 where blocklet information is not available in index file.
Load information for the block . It is the case can happen only for old stores where blocklet information is not available in index file .
// Add one row to maintain task level min max for segment pruning // add start key as index key // update min max values in case of old store // compute and set task level min values // compute and set task level max values // add file path // add pages // add version number // add schema updated time // add blocklet info // for relative blocklet id. Value is -1 because in case of old store blocklet info will // not be present in the index file and in that case we will not knwo the total number of // blocklets // store block size