Search in sources :

Example 1 with ImplicitIncludeFilterExecutorImpl

use of org.apache.carbondata.core.scan.filter.executer.ImplicitIncludeFilterExecutorImpl in project carbondata by apache.

the class FilterUtil method getIncludeFilterExecuter.

/**
 * It gives filter executer based on columnar or column group
 *
 * @param dimColResolvedFilterInfo
 * @param segmentProperties
 * @return
 */
private static FilterExecuter getIncludeFilterExecuter(DimColumnResolvedFilterInfo dimColResolvedFilterInfo, MeasureColumnResolvedFilterInfo msrColResolvedFilterInfo, SegmentProperties segmentProperties) {
    if (null != msrColResolvedFilterInfo && msrColResolvedFilterInfo.getMeasure().isColumnar()) {
        CarbonMeasure measuresFromCurrentBlock = segmentProperties.getMeasureFromCurrentBlock(msrColResolvedFilterInfo.getMeasure().getColumnId());
        if (null != measuresFromCurrentBlock) {
            // update dimension and column index according to the dimension position in current block
            MeasureColumnResolvedFilterInfo msrColResolvedFilterInfoCopyObject = msrColResolvedFilterInfo.getCopyObject();
            msrColResolvedFilterInfoCopyObject.setMeasure(measuresFromCurrentBlock);
            msrColResolvedFilterInfoCopyObject.setColumnIndex(measuresFromCurrentBlock.getOrdinal());
            msrColResolvedFilterInfoCopyObject.setType(measuresFromCurrentBlock.getDataType());
            return new IncludeFilterExecuterImpl(null, msrColResolvedFilterInfoCopyObject, segmentProperties, true);
        } else {
            return new RestructureIncludeFilterExecutorImpl(dimColResolvedFilterInfo, msrColResolvedFilterInfo, true);
        }
    }
    if (null != dimColResolvedFilterInfo) {
        CarbonDimension dimension = dimColResolvedFilterInfo.getDimension();
        if (dimension.hasEncoding(Encoding.IMPLICIT)) {
            return new ImplicitIncludeFilterExecutorImpl(dimColResolvedFilterInfo);
        } else if (dimension.isColumnar()) {
            CarbonDimension dimensionFromCurrentBlock = segmentProperties.getDimensionFromCurrentBlock(dimColResolvedFilterInfo.getDimension());
            if (null != dimensionFromCurrentBlock) {
                // update dimension and column index according to the dimension position in current block
                DimColumnResolvedFilterInfo dimColResolvedFilterInfoCopyObject = dimColResolvedFilterInfo.getCopyObject();
                dimColResolvedFilterInfoCopyObject.setDimension(dimensionFromCurrentBlock);
                dimColResolvedFilterInfoCopyObject.setColumnIndex(dimensionFromCurrentBlock.getOrdinal());
                return new IncludeFilterExecuterImpl(dimColResolvedFilterInfoCopyObject, null, segmentProperties, false);
            } else {
                return new RestructureIncludeFilterExecutorImpl(dimColResolvedFilterInfo, msrColResolvedFilterInfo, false);
            }
        } else {
            return new IncludeColGroupFilterExecuterImpl(dimColResolvedFilterInfo, segmentProperties);
        }
    } else {
        return new IncludeColGroupFilterExecuterImpl(null, segmentProperties);
    }
}
Also used : MeasureColumnResolvedFilterInfo(org.apache.carbondata.core.scan.filter.resolver.resolverinfo.MeasureColumnResolvedFilterInfo) DimColumnResolvedFilterInfo(org.apache.carbondata.core.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo) CarbonMeasure(org.apache.carbondata.core.metadata.schema.table.column.CarbonMeasure) ImplicitIncludeFilterExecutorImpl(org.apache.carbondata.core.scan.filter.executer.ImplicitIncludeFilterExecutorImpl) RestructureIncludeFilterExecutorImpl(org.apache.carbondata.core.scan.filter.executer.RestructureIncludeFilterExecutorImpl) IncludeColGroupFilterExecuterImpl(org.apache.carbondata.core.scan.filter.executer.IncludeColGroupFilterExecuterImpl) IncludeFilterExecuterImpl(org.apache.carbondata.core.scan.filter.executer.IncludeFilterExecuterImpl) CarbonDimension(org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension)

Example 2 with ImplicitIncludeFilterExecutorImpl

use of org.apache.carbondata.core.scan.filter.executer.ImplicitIncludeFilterExecutorImpl in project carbondata by apache.

the class TestBlockletDataMap method setUp.

@Before
public void setUp() throws Exception {
    CarbonImplicitDimension carbonImplicitDimension = new CarbonImplicitDimension(0, CarbonCommonConstants.CARBON_IMPLICIT_COLUMN_POSITIONID);
    DimColumnResolvedFilterInfo dimColumnEvaluatorInfo = new DimColumnResolvedFilterInfo();
    dimColumnEvaluatorInfo.setColumnIndex(0);
    dimColumnEvaluatorInfo.setRowIndex(0);
    dimColumnEvaluatorInfo.setDimension(carbonImplicitDimension);
    dimColumnEvaluatorInfo.setDimensionExistsInCurrentSilce(false);
    implicitIncludeFilterExecutor = new ImplicitIncludeFilterExecutorImpl(dimColumnEvaluatorInfo);
}
Also used : CarbonImplicitDimension(org.apache.carbondata.core.metadata.schema.table.column.CarbonImplicitDimension) DimColumnResolvedFilterInfo(org.apache.carbondata.core.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo) ImplicitIncludeFilterExecutorImpl(org.apache.carbondata.core.scan.filter.executer.ImplicitIncludeFilterExecutorImpl) Before(org.junit.Before)

Aggregations

ImplicitIncludeFilterExecutorImpl (org.apache.carbondata.core.scan.filter.executer.ImplicitIncludeFilterExecutorImpl)2 DimColumnResolvedFilterInfo (org.apache.carbondata.core.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo)2 CarbonDimension (org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension)1 CarbonImplicitDimension (org.apache.carbondata.core.metadata.schema.table.column.CarbonImplicitDimension)1 CarbonMeasure (org.apache.carbondata.core.metadata.schema.table.column.CarbonMeasure)1 IncludeColGroupFilterExecuterImpl (org.apache.carbondata.core.scan.filter.executer.IncludeColGroupFilterExecuterImpl)1 IncludeFilterExecuterImpl (org.apache.carbondata.core.scan.filter.executer.IncludeFilterExecuterImpl)1 RestructureIncludeFilterExecutorImpl (org.apache.carbondata.core.scan.filter.executer.RestructureIncludeFilterExecutorImpl)1 MeasureColumnResolvedFilterInfo (org.apache.carbondata.core.scan.filter.resolver.resolverinfo.MeasureColumnResolvedFilterInfo)1 Before (org.junit.Before)1