vvysotskyi commented on a change in pull request #1708: DRILL-7118: Filter not
getting pushed down on MapR-DB tables.
URL: https://github.com/apache/drill/pull/1708#discussion_r267705343
##########
File path:
contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/mapr/db/json/CompareFunctionsProcessor.java
##########
@@ -107,15 +107,13 @@ private static CompareFunctionsProcessor
processWithEvaluator(FunctionCall call,
LogicalExpression nameArg = call.args.get(0);
LogicalExpression valueArg = call.args.size() >= 2 ? call.args.get(1) :
null;
- if (valueArg != null) {
- if (VALUE_EXPRESSION_CLASSES.contains(nameArg.getClass())) {
- LogicalExpression swapArg = valueArg;
- valueArg = nameArg;
- nameArg = swapArg;
- evaluator.functionName =
COMPARE_FUNCTIONS_TRANSPOSE_MAP.get(functionName);
- }
- evaluator.success = nameArg.accept(evaluator, valueArg);
+ if (VALUE_EXPRESSION_CLASSES.contains(nameArg.getClass())) {
+ LogicalExpression swapArg = valueArg;
+ valueArg = nameArg;
+ nameArg = swapArg;
+ evaluator.functionName =
COMPARE_FUNCTIONS_TRANSPOSE_MAP.get(functionName);
}
+ evaluator.success = nameArg.accept(evaluator, valueArg);
Review comment:
This check was added to avoid NPE, but for the case when
`VALUE_EXPRESSION_CLASSES.contains(nameArg.getClass())` is false, and
`valueArg` is null, NPE will not occur. But should we add the next check?
```suggestion
if (nameArg != null) {
evaluator.success = nameArg.accept(evaluator, valueArg);
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services