use of org.apache.carbondata.core.scan.complextypes.StructQueryType in project carbondata by apache.
the class QueryUtil method fillChildrenDetails.
private static int fillChildrenDetails(int[] eachComplexColumnValueSize, Map<String, Dictionary> columnIdToDictionaryMap, int parentBlockIndex, CarbonDimension dimension, GenericQueryType parentQueryType) {
for (int i = 0; i < dimension.getNumberOfChild(); i++) {
switch(dimension.getListOfChildDimensions().get(i).getDataType()) {
case ARRAY:
parentQueryType.addChildren(new ArrayQueryType(dimension.getListOfChildDimensions().get(i).getColName(), dimension.getColName(), ++parentBlockIndex));
break;
case STRUCT:
parentQueryType.addChildren(new StructQueryType(dimension.getListOfChildDimensions().get(i).getColName(), dimension.getColName(), ++parentBlockIndex));
break;
default:
boolean isDirectDictionary = CarbonUtil.hasEncoding(dimension.getListOfChildDimensions().get(i).getEncoder(), Encoding.DIRECT_DICTIONARY);
parentQueryType.addChildren(new PrimitiveQueryType(dimension.getListOfChildDimensions().get(i).getColName(), dimension.getColName(), ++parentBlockIndex, dimension.getListOfChildDimensions().get(i).getDataType(), eachComplexColumnValueSize[dimension.getListOfChildDimensions().get(i).getComplexTypeOrdinal()], columnIdToDictionaryMap.get(dimension.getListOfChildDimensions().get(i).getColumnId()), isDirectDictionary));
}
if (dimension.getListOfChildDimensions().get(i).getNumberOfChild() > 0) {
parentBlockIndex = fillChildrenDetails(eachComplexColumnValueSize, columnIdToDictionaryMap, parentBlockIndex, dimension.getListOfChildDimensions().get(i), parentQueryType);
}
}
return parentBlockIndex;
}
use of org.apache.carbondata.core.scan.complextypes.StructQueryType in project carbondata by apache.
the class QueryUtil method fillParentDetails.
private static void fillParentDetails(Map<Integer, Integer> dimensionToBlockIndexMap, CarbonDimension dimension, Map<Integer, GenericQueryType> complexTypeMap, int[] eachComplexColumnValueSize, Map<String, Dictionary> columnIdToDictionaryMap) {
int parentBlockIndex = dimensionToBlockIndexMap.get(dimension.getOrdinal());
GenericQueryType parentQueryType = dimension.getDataType().equals(DataType.ARRAY) ? new ArrayQueryType(dimension.getColName(), dimension.getColName(), parentBlockIndex) : new StructQueryType(dimension.getColName(), dimension.getColName(), dimensionToBlockIndexMap.get(dimension.getOrdinal()));
complexTypeMap.put(dimension.getOrdinal(), parentQueryType);
parentBlockIndex = fillChildrenDetails(eachComplexColumnValueSize, columnIdToDictionaryMap, parentBlockIndex, dimension, parentQueryType);
}
Aggregations