Search in sources :

Example 1 with PrimitiveQueryType

use of org.apache.carbondata.core.scan.complextypes.PrimitiveQueryType 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;
}
Also used : StructQueryType(org.apache.carbondata.core.scan.complextypes.StructQueryType) PrimitiveQueryType(org.apache.carbondata.core.scan.complextypes.PrimitiveQueryType) ArrayQueryType(org.apache.carbondata.core.scan.complextypes.ArrayQueryType)

Aggregations

ArrayQueryType (org.apache.carbondata.core.scan.complextypes.ArrayQueryType)1 PrimitiveQueryType (org.apache.carbondata.core.scan.complextypes.PrimitiveQueryType)1 StructQueryType (org.apache.carbondata.core.scan.complextypes.StructQueryType)1