core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java
/**
   * Fill allDimensions and allMeasures for carbon table
   *
   * @param tableSchema
   */
Fill allDimensions and allMeasures for carbon table
@param tableSchema
Fill allDimensions and allMeasures for carbon table @param tableSchema
private void fillDimensionsAndMeasuresForTables(TableSchema tableSchema) {
    List<CarbonDimension> primitiveDimensions = new ArrayList<CarbonDimension>();
    List<CarbonDimension> implicitDimensions = new ArrayList<CarbonDimension>();
    allDimensions = new ArrayList<CarbonDimension>();
    allMeasures = new ArrayList<CarbonMeasure>();
    this.tablePrimitiveDimensionsMap.put(this.tableUniqueName, primitiveDimensions);
    this.tableImplicitDimensionsMap.put(tableSchema.getTableName(), implicitDimensions);
    int dimensionOrdinal = 0;
    int measureOrdinal = 0;
    int keyOrdinal = 0;
    int columnGroupOrdinal = -1;
    int previousColumnGroupId = -1;
    List<ColumnSchema> listOfColumns = tableSchema.getListOfColumns();
    int complexTypeOrdinal = -1;
    for (int i = 0; i < listOfColumns.size(); i++) {
      ColumnSchema columnSchema = listOfColumns.get(i);
      if (columnSchema.isDimensionColumn()) {
        if (columnSchema.getNumberOfChild() > 0) {
          CarbonDimension complexDimension =
              new CarbonDimension(columnSchema, dimensionOrdinal++,
                  columnSchema.getSchemaOrdinal(), -1, -1, ++complexTypeOrdinal);
          complexDimension.initializeChildDimensionsList(columnSchema.getNumberOfChild());
          allDimensions.add(complexDimension);
          dimensionOrdinal =
              readAllComplexTypeChildrens(dimensionOrdinal, columnSchema.getNumberOfChild(),
                  listOfColumns, complexDimension, primitiveDimensions);
          i = dimensionOrdinal - 1;
          complexTypeOrdinal = assignComplexOrdinal(complexDimension, complexTypeOrdinal);
        } else {
          if (!columnSchema.isInvisible() && columnSchema.isSortColumn()) {
            this.numberOfSortColumns++;
          }
          if (!columnSchema.getEncodingList().contains(Encoding.DICTIONARY)) {
            CarbonDimension dimension =
                new CarbonDimension(columnSchema, dimensionOrdinal++,
                    columnSchema.getSchemaOrdinal(), -1, -1, -1);
            if (!columnSchema.isInvisible() && columnSchema.isSortColumn()) {
              this.numberOfNoDictSortColumns++;
            }
            allDimensions.add(dimension);
            primitiveDimensions.add(dimension);
          } else if (columnSchema.getEncodingList().contains(Encoding.DICTIONARY)
              && columnSchema.getColumnGroupId() == -1) {
            CarbonDimension dimension =
                new CarbonDimension(columnSchema, dimensionOrdinal++,
                    columnSchema.getSchemaOrdinal(), keyOrdinal++, -1, -1);
            allDimensions.add(dimension);
            primitiveDimensions.add(dimension);
          } else {
            columnGroupOrdinal =
                previousColumnGroupId == columnSchema.getColumnGroupId() ? ++columnGroupOrdinal : 0;
            previousColumnGroupId = columnSchema.getColumnGroupId();
            CarbonDimension dimension = new CarbonDimension(columnSchema, dimensionOrdinal++,
                columnSchema.getSchemaOrdinal(), keyOrdinal++,
                columnGroupOrdinal, -1);
            allDimensions.add(dimension);
            primitiveDimensions.add(dimension);
          }
        }
      } else {
        allMeasures.add(new CarbonMeasure(columnSchema, measureOrdinal++,
            columnSchema.getSchemaOrdinal()));
      }
    }
    fillVisibleDimensions(tableSchema.getTableName());
    fillVisibleMeasures(tableSchema.getTableName());
    addImplicitDimension(dimensionOrdinal, implicitDimensions);
    dimensionOrdinalMax = dimensionOrdinal;
  }
private void fillDimensionsAndMeasuresForTables ( TableSchema tableSchema ) { List < CarbonDimension > primitiveDimensions = new ArrayList < CarbonDimension > ( ) ; List < CarbonDimension > implicitDimensions = new ArrayList < CarbonDimension > ( ) ; allDimensions = new ArrayList < CarbonDimension > ( ) ; allMeasures = new ArrayList < CarbonMeasure > ( ) ; this . tablePrimitiveDimensionsMap . put ( this . tableUniqueName , primitiveDimensions ) ; this . tableImplicitDimensionsMap . put ( tableSchema . getTableName ( ) , implicitDimensions ) ; int dimensionOrdinal = 0 ; int measureOrdinal = 0 ; int keyOrdinal = 0 ; int columnGroupOrdinal = - 1 ; int previousColumnGroupId = - 1 ; List < ColumnSchema > listOfColumns = tableSchema . getListOfColumns ( ) ; int complexTypeOrdinal = - 1 ; for ( int i = 0 ; i < listOfColumns . size ( ) ; i ++ ) { ColumnSchema columnSchema = listOfColumns . get ( i ) ; if ( columnSchema . isDimensionColumn ( ) ) { if ( columnSchema . getNumberOfChild ( ) > 0 ) { CarbonDimension complexDimension = new CarbonDimension ( columnSchema , dimensionOrdinal ++ , columnSchema . getSchemaOrdinal ( ) , - 1 , - 1 , ++ complexTypeOrdinal ) ; complexDimension . initializeChildDimensionsList ( columnSchema . getNumberOfChild ( ) ) ; allDimensions . add ( complexDimension ) ; dimensionOrdinal = readAllComplexTypeChildrens ( dimensionOrdinal , columnSchema . getNumberOfChild ( ) , listOfColumns , complexDimension , primitiveDimensions ) ; i = dimensionOrdinal - 1 ; complexTypeOrdinal = assignComplexOrdinal ( complexDimension , complexTypeOrdinal ) ; } else { if ( ! columnSchema . isInvisible ( ) && columnSchema . isSortColumn ( ) ) { this . numberOfSortColumns ++ ; } if ( ! columnSchema . getEncodingList ( ) . contains ( Encoding . DICTIONARY ) ) { CarbonDimension dimension = new CarbonDimension ( columnSchema , dimensionOrdinal ++ , columnSchema . getSchemaOrdinal ( ) , - 1 , - 1 , - 1 ) ; if ( ! columnSchema . isInvisible ( ) && columnSchema . isSortColumn ( ) ) { this . numberOfNoDictSortColumns ++ ; } allDimensions . add ( dimension ) ; primitiveDimensions . add ( dimension ) ; } else if ( columnSchema . getEncodingList ( ) . contains ( Encoding . DICTIONARY ) && columnSchema . getColumnGroupId ( ) == - 1 ) { CarbonDimension dimension = new CarbonDimension ( columnSchema , dimensionOrdinal ++ , columnSchema . getSchemaOrdinal ( ) , keyOrdinal ++ , - 1 , - 1 ) ; allDimensions . add ( dimension ) ; primitiveDimensions . add ( dimension ) ; } else { columnGroupOrdinal = previousColumnGroupId == columnSchema . getColumnGroupId ( ) ? ++ columnGroupOrdinal : 0 ; previousColumnGroupId = columnSchema . getColumnGroupId ( ) ; CarbonDimension dimension = new CarbonDimension ( columnSchema , dimensionOrdinal ++ , columnSchema . getSchemaOrdinal ( ) , keyOrdinal ++ , columnGroupOrdinal , - 1 ) ; allDimensions . add ( dimension ) ; primitiveDimensions . add ( dimension ) ; } } } else { allMeasures . add ( new CarbonMeasure ( columnSchema , measureOrdinal ++ , columnSchema . getSchemaOrdinal ( ) ) ) ; } } fillVisibleDimensions ( tableSchema . getTableName ( ) ) ; fillVisibleMeasures ( tableSchema . getTableName ( ) ) ; addImplicitDimension ( dimensionOrdinal , implicitDimensions ) ; dimensionOrdinalMax = dimensionOrdinal ; }
Fill allDimensions and allMeasures for carbon table
 @param tableSchema
Fill allDimensions and allMeasures for carbon table @param tableSchema