Search in sources :

Example 6 with DimColumnResolvedFilterInfo

use of org.apache.carbondata.core.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo in project carbondata by apache.

the class RowLevelRangeFilterResolverImpl method resolve.

/**
   * Method which will resolve the filter expression by converting the filter
   * member to its assigned dictionary values.
   */
public void resolve(AbsoluteTableIdentifier absoluteTableIdentifier) throws FilterUnsupportedException {
    DimColumnResolvedFilterInfo dimColumnEvaluatorInfo = null;
    MeasureColumnResolvedFilterInfo msrColumnEvalutorInfo = null;
    int index = 0;
    if (exp instanceof BinaryLogicalExpression) {
        BinaryLogicalExpression conditionalExpression = (BinaryLogicalExpression) exp;
        List<ColumnExpression> columnList = conditionalExpression.getColumnList();
        for (ColumnExpression columnExpression : columnList) {
            if (columnExpression.isDimension()) {
                dimColumnEvaluatorInfo = new DimColumnResolvedFilterInfo();
                DimColumnFilterInfo filterInfo = new DimColumnFilterInfo();
                dimColumnEvaluatorInfo.setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
                dimColumnEvaluatorInfo.setRowIndex(index++);
                dimColumnEvaluatorInfo.setDimension(columnExpression.getDimension());
                dimColumnEvaluatorInfo.setDimensionExistsInCurrentSilce(false);
                if (columnExpression.getDimension().hasEncoding(Encoding.DIRECT_DICTIONARY)) {
                    filterInfo.setFilterList(getDirectSurrogateValues(columnExpression));
                } else {
                    filterInfo.setFilterListForNoDictionaryCols(getNoDictionaryRangeValues());
                }
                filterInfo.setIncludeFilter(isIncludeFilter);
                dimColumnEvaluatorInfo.setFilterValues(filterInfo);
                dimColumnEvaluatorInfo.addDimensionResolvedFilterInstance(columnExpression.getDimension(), filterInfo);
                dimColEvaluatorInfoList.add(dimColumnEvaluatorInfo);
            } else {
                msrColumnEvalutorInfo = new MeasureColumnResolvedFilterInfo();
                msrColumnEvalutorInfo.setRowIndex(index++);
                msrColumnEvalutorInfo.setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
                msrColumnEvalutorInfo.setType(columnExpression.getCarbonColumn().getDataType());
                msrColEvalutorInfoList.add(msrColumnEvalutorInfo);
            }
        }
    }
}
Also used : MeasureColumnResolvedFilterInfo(org.apache.carbondata.core.scan.filter.resolver.resolverinfo.MeasureColumnResolvedFilterInfo) DimColumnResolvedFilterInfo(org.apache.carbondata.core.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo) BinaryLogicalExpression(org.apache.carbondata.core.scan.expression.logical.BinaryLogicalExpression) DimColumnFilterInfo(org.apache.carbondata.core.scan.filter.DimColumnFilterInfo) ColumnExpression(org.apache.carbondata.core.scan.expression.ColumnExpression)

Aggregations

DimColumnResolvedFilterInfo (org.apache.carbondata.core.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo)6 MeasureColumnResolvedFilterInfo (org.apache.carbondata.core.scan.filter.resolver.resolverinfo.MeasureColumnResolvedFilterInfo)4 CarbonDimension (org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension)2 ColumnExpression (org.apache.carbondata.core.scan.expression.ColumnExpression)2 GenericQueryType (org.apache.carbondata.core.scan.filter.GenericQueryType)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 DataOutputStream (java.io.DataOutputStream)1 IOException (java.io.IOException)1 BigDecimal (java.math.BigDecimal)1 DimensionColumnDataChunk (org.apache.carbondata.core.datastore.chunk.DimensionColumnDataChunk)1 MeasureColumnDataChunk (org.apache.carbondata.core.datastore.chunk.MeasureColumnDataChunk)1 VariableLengthDimensionDataChunk (org.apache.carbondata.core.datastore.chunk.impl.VariableLengthDimensionDataChunk)1 DataType (org.apache.carbondata.core.metadata.datatype.DataType)1 ConditionalExpression (org.apache.carbondata.core.scan.expression.conditional.ConditionalExpression)1 BinaryLogicalExpression (org.apache.carbondata.core.scan.expression.logical.BinaryLogicalExpression)1 DimColumnFilterInfo (org.apache.carbondata.core.scan.filter.DimColumnFilterInfo)1 ExcludeColGroupFilterExecuterImpl (org.apache.carbondata.core.scan.filter.executer.ExcludeColGroupFilterExecuterImpl)1 ExcludeFilterExecuterImpl (org.apache.carbondata.core.scan.filter.executer.ExcludeFilterExecuterImpl)1 IncludeColGroupFilterExecuterImpl (org.apache.carbondata.core.scan.filter.executer.IncludeColGroupFilterExecuterImpl)1 IncludeFilterExecuterImpl (org.apache.carbondata.core.scan.filter.executer.IncludeFilterExecuterImpl)1