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);
}
}
}
}
Aggregations