jcamachor commented on a change in pull request #2163:
URL: https://github.com/apache/hive/pull/2163#discussion_r620876210
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRexExecutorImpl.java
##########
@@ -52,6 +56,10 @@ public void reduce(RexBuilder rexBuilder, List<RexNode>
constExps, List<RexNode>
// initialize the converter
ExprNodeConverter converter = new ExprNodeConverter("", null, null, null,
new HashSet<>(), rexBuilder.getTypeFactory());
+
+ if (rexNode.getKind() == SqlKind.IS_DISTINCT_FROM) {
Review comment:
This should be move to the `ExprNodeConverter` itself. For instance,
check `visitCall` method.
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java
##########
@@ -788,6 +789,9 @@ public ASTNode visitCall(RexCall call) {
}
}
break;
+ case IS_DISTINCT_FROM:
+ // convert IS DISTINCT FROM to NOT (IS NOT DISTINCT FROM)
+ return visitCall((RexCall)
RexUtil.not(rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_DISTINCT_FROM,
call.getOperands())));
Review comment:
If you rely on `buildAST(SqlOperator op, List<ASTNode> children)`, you
would not have to declare the function in `FunctionRegistry`?
i) Call `visitCall` on the call operands, ii) then `buildAST` with
`SqlStdOperatorTable.IS_NOT_DISTINCT_FROM`, iii) then `buildAST` with the
output of the previous one.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]