private void fillOrdinalToBlockMappingForDimension(){
  int blockOrdinal=-1;
  CarbonDimension dimension=null;
  int index=0;
  int prvcolumnGroupId=-1;
  while (index < dimensions.size()) {
    dimension=dimensions.get(index);
    if (dimension.isColumnar() || dimension.columnGroupId() != prvcolumnGroupId) {
      blockOrdinal++;
    }
    dimensionOrdinalToBlockMapping.put(dimension.getOrdinal(),blockOrdinal);
    prvcolumnGroupId=dimension.columnGroupId();
    index++;
  }
  index=0;
  while (index < complexDimensions.size()) {
    dimension=complexDimensions.get(index);
    dimensionOrdinalToBlockMapping.put(dimension.getOrdinal(),++blockOrdinal);
    blockOrdinal=fillComplexDimensionChildBlockIndex(blockOrdinal,dimension);
    index++;
  }
  fillBlockToDimensionOrdinalMapping();
}

private void fillOrdinalToBlockMappingForDimension ( ) { int blockOrdinal = - 1 ; CarbonDimension dimension = null ; int index = 0 ; int prvcolumnGroupId = - 1 ; while ( index < dimensions . size ( ) ) { dimension = dimensions . get ( index ) ; if ( dimension . isColumnar ( ) || dimension . columnGroupId ( ) != prvcolumnGroupId ) { blockOrdinal ++ ; } dimensionOrdinalToBlockMapping . put ( dimension . getOrdinal ( ) , blockOrdinal ) ; prvcolumnGroupId = dimension . columnGroupId ( ) ; index ++ ; } index = 0 ; while ( index < complexDimensions . size ( ) ) { dimension = complexDimensions . get ( index ) ; dimensionOrdinalToBlockMapping . put ( dimension . getOrdinal ( ) , ++ blockOrdinal ) ; blockOrdinal = fillComplexDimensionChildBlockIndex ( blockOrdinal , dimension ) ; index ++ ; } fillBlockToDimensionOrdinalMapping ( ) ; }
below method is to fill the dimension and its mapping to file blocks all the column will point to same column group
