processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/FieldEncoderFactory.java
/**
   * This method may be called recursively if the carbon column is complex type.
   *
   * @return GenericDataType
   */
This method may be called recursively if the carbon column is complex type.
This method may be called recursively if the carbon column is complex type .
private static GenericDataType createComplexType(CarbonColumn carbonColumn, String parentName,
      Cache<DictionaryColumnUniqueIdentifier, Dictionary> cache,
      AbsoluteTableIdentifier absoluteTableIdentifier, DictionaryClient client, Boolean useOnePass,
      Map<Object, Integer> localCache) {
    DataType dataType = carbonColumn.getDataType();
    if (DataTypes.isArrayType(dataType)) {
      List<CarbonDimension> listOfChildDimensions =
          ((CarbonDimension) carbonColumn).getListOfChildDimensions();
      ArrayDataType arrayDataType =
          new ArrayDataType(carbonColumn.getColName(), parentName, carbonColumn.getColumnId());
      for (CarbonDimension dimension : listOfChildDimensions) {
        arrayDataType.addChildren(
            createComplexType(dimension, carbonColumn.getColName(), cache, absoluteTableIdentifier,
                client, useOnePass, localCache));
      }
      return arrayDataType;
    } else if (DataTypes.isStructType(dataType)) {
      List<CarbonDimension> dimensions =
          ((CarbonDimension) carbonColumn).getListOfChildDimensions();
      StructDataType structDataType =
          new StructDataType(carbonColumn.getColName(), parentName, carbonColumn.getColumnId());
      for (CarbonDimension dimension : dimensions) {
        structDataType.addChildren(
            createComplexType(dimension, carbonColumn.getColName(), cache, absoluteTableIdentifier,
                client, useOnePass, localCache));
      }
      return structDataType;
    } else if (DataTypes.isMapType(dataType)) {
      throw new UnsupportedOperationException("Complex type Map is not supported yet");
    } else {
      return new PrimitiveDataType(carbonColumn.getColName(), parentName,
          carbonColumn.getColumnId(), (CarbonDimension) carbonColumn, cache,
          absoluteTableIdentifier, client, useOnePass, localCache);
    }
  }
private static GenericDataType createComplexType ( CarbonColumn carbonColumn , String parentName , Cache < DictionaryColumnUniqueIdentifier , Dictionary > cache , AbsoluteTableIdentifier absoluteTableIdentifier , DictionaryClient client , Boolean useOnePass , Map < Object , Integer > localCache ) { DataType dataType = carbonColumn . getDataType ( ) ; if ( DataTypes . isArrayType ( dataType ) ) { List < CarbonDimension > listOfChildDimensions = ( ( CarbonDimension ) carbonColumn ) . getListOfChildDimensions ( ) ; ArrayDataType arrayDataType = new ArrayDataType ( carbonColumn . getColName ( ) , parentName , carbonColumn . getColumnId ( ) ) ; for ( CarbonDimension dimension : listOfChildDimensions ) { arrayDataType . addChildren ( createComplexType ( dimension , carbonColumn . getColName ( ) , cache , absoluteTableIdentifier , client , useOnePass , localCache ) ) ; } return arrayDataType ; } else if ( DataTypes . isStructType ( dataType ) ) { List < CarbonDimension > dimensions = ( ( CarbonDimension ) carbonColumn ) . getListOfChildDimensions ( ) ; StructDataType structDataType = new StructDataType ( carbonColumn . getColName ( ) , parentName , carbonColumn . getColumnId ( ) ) ; for ( CarbonDimension dimension : dimensions ) { structDataType . addChildren ( createComplexType ( dimension , carbonColumn . getColName ( ) , cache , absoluteTableIdentifier , client , useOnePass , localCache ) ) ; } return structDataType ; } else if ( DataTypes . isMapType ( dataType ) ) { throw new UnsupportedOperationException ( "Complex type Map is not supported yet" ) ; } else { return new PrimitiveDataType ( carbonColumn . getColName ( ) , parentName , carbonColumn . getColumnId ( ) , ( CarbonDimension ) carbonColumn , cache , absoluteTableIdentifier , client , useOnePass , localCache ) ; } }
This method may be called recursively if the carbon column is complex type.
This method may be called recursively if the carbon column is complex type .
// Create array parser with complex delimiter // Create struct parser with complex delimiter