use of org.apache.carbondata.core.scan.filter.resolver.resolverinfo.MeasureColumnResolvedFilterInfo in project carbondata by apache.
the class RowLevelFilterResolverImpl method resolve.
/**
* Method which will resolve the filter expression by converting the filter member
* to its assigned dictionary values.
*/
public void resolve(AbsoluteTableIdentifier absoluteTableIdentifier, TableProvider tableProvider) {
DimColumnResolvedFilterInfo dimColumnEvaluatorInfo = null;
MeasureColumnResolvedFilterInfo msrColumnEvalutorInfo = null;
int index = 0;
if (exp instanceof ConditionalExpression) {
ConditionalExpression conditionalExpression = (ConditionalExpression) exp;
List<ColumnExpression> columnList = conditionalExpression.getColumnList();
for (ColumnExpression columnExpression : columnList) {
if (columnExpression.isDimension()) {
dimColumnEvaluatorInfo = new DimColumnResolvedFilterInfo();
dimColumnEvaluatorInfo.setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
dimColumnEvaluatorInfo.setRowIndex(index++);
dimColumnEvaluatorInfo.setDimension(columnExpression.getDimension());
dimColumnEvaluatorInfo.setDimensionExistsInCurrentSilce(false);
dimColEvaluatorInfoList.add(dimColumnEvaluatorInfo);
} else {
msrColumnEvalutorInfo = new MeasureColumnResolvedFilterInfo();
msrColumnEvalutorInfo.setCarbonColumn(columnExpression.getCarbonColumn());
msrColumnEvalutorInfo.setRowIndex(index++);
msrColumnEvalutorInfo.setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
msrColumnEvalutorInfo.setMeasure(columnExpression.getMeasure());
msrColumnEvalutorInfo.setType(columnExpression.getCarbonColumn().getDataType());
msrColEvalutorInfoList.add(msrColumnEvalutorInfo);
}
}
}
}
use of org.apache.carbondata.core.scan.filter.resolver.resolverinfo.MeasureColumnResolvedFilterInfo 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, TableProvider tableProvider) 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();
ColumnFilterInfo filterInfo = new ColumnFilterInfo();
dimColumnEvaluatorInfo.setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
dimColumnEvaluatorInfo.setRowIndex(index++);
dimColumnEvaluatorInfo.setDimension(columnExpression.getDimension());
dimColumnEvaluatorInfo.setDimensionExistsInCurrentSilce(false);
if (columnExpression.getDimension().hasEncoding(Encoding.DIRECT_DICTIONARY)) {
if (!isIncludeFilter) {
filterInfo.setExcludeFilterList(getDirectSurrogateValues(columnExpression));
} else {
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();
ColumnFilterInfo filterInfo = new ColumnFilterInfo();
msrColumnEvalutorInfo.setMeasure(columnExpression.getMeasure());
msrColumnEvalutorInfo.setRowIndex(index++);
msrColumnEvalutorInfo.setCarbonColumn(columnExpression.getCarbonColumn());
msrColumnEvalutorInfo.setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
msrColumnEvalutorInfo.setType(columnExpression.getCarbonColumn().getDataType());
msrColumnEvalutorInfo.setMeasureExistsInCurrentSilce(false);
filterInfo.setMeasuresFilterValuesList(getMeasureRangeValues(columnExpression.getMeasure()));
filterInfo.setIncludeFilter(isIncludeFilter);
msrColumnEvalutorInfo.setFilterValues(filterInfo);
msrColumnEvalutorInfo.addMeasureResolvedFilterInstance(columnExpression.getMeasure(), filterInfo);
msrColEvalutorInfoList.add(msrColumnEvalutorInfo);
}
}
}
}
Aggregations