Search in sources :

Example 1 with ArrayQueryType

use of org.apache.carbondata.core.scan.complextypes.ArrayQueryType 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)

Example 2 with ArrayQueryType

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

Aggregations

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