core/src/main/java/org/apache/carbondata/core/scan/executor/impl/AbstractQueryExecutor.java
/**
   * Read the file footer of block file and get the blocklets to query
   */
Read the file footer of block file and get the blocklets to query
Read the file footer of block file and get the blocklets to query
private void readAndFillBlockletInfo(TableBlockInfo blockInfo,
      List<TableBlockInfo> tableBlockInfos, BlockletDetailInfo blockletDetailInfo)
      throws IOException {
    blockInfo.setBlockOffset(blockletDetailInfo.getBlockFooterOffset());
    blockInfo.setDetailInfo(null);
    DataFileFooter fileFooter = CarbonUtil.readMetadatFile(blockInfo);
    blockInfo.setDetailInfo(blockletDetailInfo);
    List<BlockletInfo> blockletList = fileFooter.getBlockletList();
    short count = 0;
    for (BlockletInfo blockletInfo: blockletList) {
      TableBlockInfo info = blockInfo.copy();
      BlockletDetailInfo detailInfo = info.getDetailInfo();
      detailInfo.setRowCount(blockletInfo.getNumberOfRows());
      byte[][] maxValues = CarbonUtil.updateMinMaxValues(fileFooter,
          blockletInfo.getBlockletIndex().getMinMaxIndex().getMaxValues(),
          blockletInfo.getBlockletIndex().getMinMaxIndex().getMinValues(), false);
      byte[][] minValues = CarbonUtil.updateMinMaxValues(fileFooter,
          blockletInfo.getBlockletIndex().getMinMaxIndex().getMaxValues(),
          blockletInfo.getBlockletIndex().getMinMaxIndex().getMinValues(), true);
      blockletInfo.getBlockletIndex().getMinMaxIndex().setMaxValues(maxValues);
      blockletInfo.getBlockletIndex().getMinMaxIndex().setMinValues(minValues);
      detailInfo.setBlockletInfo(blockletInfo);
      detailInfo.setPagesCount((short) blockletInfo.getNumberOfPages());
      detailInfo.setBlockletId(count);
      info.setDataBlockFromOldStore(true);
      tableBlockInfos.add(info);
      count++;
    }
  }
private void readAndFillBlockletInfo ( TableBlockInfo blockInfo , List < TableBlockInfo > tableBlockInfos , BlockletDetailInfo blockletDetailInfo ) throws IOException { blockInfo . setBlockOffset ( blockletDetailInfo . getBlockFooterOffset ( ) ) ; blockInfo . setDetailInfo ( null ) ; DataFileFooter fileFooter = CarbonUtil . readMetadatFile ( blockInfo ) ; blockInfo . setDetailInfo ( blockletDetailInfo ) ; List < BlockletInfo > blockletList = fileFooter . getBlockletList ( ) ; short count = 0 ; for ( BlockletInfo blockletInfo : blockletList ) { TableBlockInfo info = blockInfo . copy ( ) ; BlockletDetailInfo detailInfo = info . getDetailInfo ( ) ; detailInfo . setRowCount ( blockletInfo . getNumberOfRows ( ) ) ; byte [ ] [ ] maxValues = CarbonUtil . updateMinMaxValues ( fileFooter , blockletInfo . getBlockletIndex ( ) . getMinMaxIndex ( ) . getMaxValues ( ) , blockletInfo . getBlockletIndex ( ) . getMinMaxIndex ( ) . getMinValues ( ) , false ) ; byte [ ] [ ] minValues = CarbonUtil . updateMinMaxValues ( fileFooter , blockletInfo . getBlockletIndex ( ) . getMinMaxIndex ( ) . getMaxValues ( ) , blockletInfo . getBlockletIndex ( ) . getMinMaxIndex ( ) . getMinValues ( ) , true ) ; blockletInfo . getBlockletIndex ( ) . getMinMaxIndex ( ) . setMaxValues ( maxValues ) ; blockletInfo . getBlockletIndex ( ) . getMinMaxIndex ( ) . setMinValues ( minValues ) ; detailInfo . setBlockletInfo ( blockletInfo ) ; detailInfo . setPagesCount ( ( short ) blockletInfo . getNumberOfPages ( ) ) ; detailInfo . setBlockletId ( count ) ; info . setDataBlockFromOldStore ( true ) ; tableBlockInfos . add ( info ) ; count ++ ; } }
Read the file footer of block file and get the blocklets to query
Read the file footer of block file and get the blocklets to query
// update min and max values in case of old store for measures as min and max is written // opposite for measures in old store