Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1996#discussion_r170451613
--- Diff:
core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecuterImpl.java
---
@@ -276,12 +277,82 @@ public BitSetGroup applyFilter(BlocksChunkHolder
blockChunkHolder, boolean useBi
public boolean applyFilter(RowIntf value, int dimOrdinalMax)
throws FilterUnsupportedException, IOException {
try {
- return exp.evaluate(value).getBoolean();
+ Boolean result = exp.evaluate(createRow(value,
dimOrdinalMax)).getBoolean();
+ return result == null ? false : result;
} catch (FilterIllegalMemberException e) {
throw new FilterUnsupportedException(e);
}
}
+ /**
+ * create row for row filter to evaluate expression
+ */
+ private RowIntf createRow(RowIntf value, int dimOrdinalMax) throws
IOException {
+ Object[] record = new Object[value.size()];
+ String memberString;
+ for (int i = 0; i < dimColEvaluatorInfoList.size(); i++) {
+ DimColumnResolvedFilterInfo dimColumnEvaluatorInfo =
dimColEvaluatorInfoList.get(i);
+ int index = dimColumnEvaluatorInfo.getDimension().getOrdinal();
+ // if filter dimension is not present in the current add its default
value
+ if (!isDimensionPresentInCurrentBlock[i]) {
+ // fill default value here
+ record[index] = getDimensionDefaultValue(dimColumnEvaluatorInfo);
+ continue;
--- End diff --
give comment why continue
---