Search in sources :

Example 6 with QueryDimension

use of org.apache.carbondata.core.scan.model.QueryDimension in project carbondata by apache.

the class QueryUtil method getComplexDimensionsMap.

/**
   * Below method will be used to get the map of for complex dimension and its type
   * which will be used to during query execution to
   *
   * @param queryDimensions          complex dimension in query
   * @param dimensionToBlockIndexMap dimension to block index in file map
   * @return complex dimension and query type
   */
public static Map<Integer, GenericQueryType> getComplexDimensionsMap(List<QueryDimension> queryDimensions, Map<Integer, Integer> dimensionToBlockIndexMap, int[] eachComplexColumnValueSize, Map<String, Dictionary> columnIdToDictionaryMap, Set<CarbonDimension> filterDimensions) {
    Map<Integer, GenericQueryType> complexTypeMap = new HashMap<Integer, GenericQueryType>();
    for (QueryDimension dimension : queryDimensions) {
        CarbonDimension actualDimension = dimension.getDimension();
        if (actualDimension.getNumberOfChild() == 0) {
            continue;
        }
        fillParentDetails(dimensionToBlockIndexMap, actualDimension, complexTypeMap, eachComplexColumnValueSize, columnIdToDictionaryMap);
    }
    if (null != filterDimensions) {
        for (CarbonDimension filterDimension : filterDimensions) {
            // do not fill nay details for implicit dimension type
            if (filterDimension.hasEncoding(Encoding.IMPLICIT) || filterDimension.getNumberOfChild() == 0) {
                continue;
            }
            fillParentDetails(dimensionToBlockIndexMap, filterDimension, complexTypeMap, eachComplexColumnValueSize, columnIdToDictionaryMap);
        }
    }
    return complexTypeMap;
}
Also used : HashMap(java.util.HashMap) GenericQueryType(org.apache.carbondata.core.scan.filter.GenericQueryType) QueryDimension(org.apache.carbondata.core.scan.model.QueryDimension) CarbonDimension(org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension)

Aggregations

QueryDimension (org.apache.carbondata.core.scan.model.QueryDimension)6 CarbonDimension (org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension)4 ArrayList (java.util.ArrayList)3 CarbonMeasure (org.apache.carbondata.core.metadata.schema.table.column.CarbonMeasure)3 QueryMeasure (org.apache.carbondata.core.scan.model.QueryMeasure)3 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 IndexKey (org.apache.carbondata.core.datastore.IndexKey)1 SegmentProperties (org.apache.carbondata.core.datastore.block.SegmentProperties)1 KeyGenException (org.apache.carbondata.core.keygenerator.KeyGenException)1 KeyGenerator (org.apache.carbondata.core.keygenerator.KeyGenerator)1 CarbonTable (org.apache.carbondata.core.metadata.schema.table.CarbonTable)1 QueryExecutionException (org.apache.carbondata.core.scan.executor.exception.QueryExecutionException)1 BlockExecutionInfo (org.apache.carbondata.core.scan.executor.infos.BlockExecutionInfo)1 DimensionInfo (org.apache.carbondata.core.scan.executor.infos.DimensionInfo)1 GenericQueryType (org.apache.carbondata.core.scan.filter.GenericQueryType)1 QueryModel (org.apache.carbondata.core.scan.model.QueryModel)1