core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java
/**
   * Read all primitive/complex children and set it as list of child carbon dimension to parent
   * dimension
   *
   * @param dimensionOrdinal
   * @param childCount
   * @param listOfColumns
   * @param parentDimension
   * @return
   */
Read all primitive/complex children and set it as list of child carbon dimension to parent
dimension


Read all primitive / complex children and set it as list of child carbon dimension to parent dimension
private int readAllComplexTypeChildrens(int dimensionOrdinal, int childCount,
      List<ColumnSchema> listOfColumns, CarbonDimension parentDimension,
      List<CarbonDimension> primitiveDimensions) {
    for (int i = 0; i < childCount; i++) {
      ColumnSchema columnSchema = listOfColumns.get(dimensionOrdinal);
      if (columnSchema.isDimensionColumn()) {
        if (columnSchema.getNumberOfChild() > 0) {
          CarbonDimension complexDimension =
              new CarbonDimension(columnSchema, dimensionOrdinal++,
                  columnSchema.getSchemaOrdinal(), -1, -1, -1);
          complexDimension.initializeChildDimensionsList(columnSchema.getNumberOfChild());
          parentDimension.getListOfChildDimensions().add(complexDimension);
          dimensionOrdinal =
              readAllComplexTypeChildrens(dimensionOrdinal, columnSchema.getNumberOfChild(),
                  listOfColumns, complexDimension, primitiveDimensions);
        } else {
          CarbonDimension carbonDimension =
              new CarbonDimension(columnSchema, dimensionOrdinal++,
                  columnSchema.getSchemaOrdinal(), -1, -1, -1);
          parentDimension.getListOfChildDimensions().add(carbonDimension);
          primitiveDimensions.add(carbonDimension);
        }
      }
    }
    return dimensionOrdinal;
  }
private int readAllComplexTypeChildrens ( int dimensionOrdinal , int childCount , List < ColumnSchema > listOfColumns , CarbonDimension parentDimension , List < CarbonDimension > primitiveDimensions ) { for ( int i = 0 ; i < childCount ; i ++ ) { ColumnSchema columnSchema = listOfColumns . get ( dimensionOrdinal ) ; if ( columnSchema . isDimensionColumn ( ) ) { if ( columnSchema . getNumberOfChild ( ) > 0 ) { CarbonDimension complexDimension = new CarbonDimension ( columnSchema , dimensionOrdinal ++ , columnSchema . getSchemaOrdinal ( ) , - 1 , - 1 , - 1 ) ; complexDimension . initializeChildDimensionsList ( columnSchema . getNumberOfChild ( ) ) ; parentDimension . getListOfChildDimensions ( ) . add ( complexDimension ) ; dimensionOrdinal = readAllComplexTypeChildrens ( dimensionOrdinal , columnSchema . getNumberOfChild ( ) , listOfColumns , complexDimension , primitiveDimensions ) ; } else { CarbonDimension carbonDimension = new CarbonDimension ( columnSchema , dimensionOrdinal ++ , columnSchema . getSchemaOrdinal ( ) , - 1 , - 1 , - 1 ) ; parentDimension . getListOfChildDimensions ( ) . add ( carbonDimension ) ; primitiveDimensions . add ( carbonDimension ) ; } } } return dimensionOrdinal ; }
Read all primitive/complex children and set it as list of child carbon dimension to parent
 dimension
Read all primitive / complex children and set it as list of child carbon dimension to parent dimension