DonnyZone commented on a change in pull request #1057:
URL: https://github.com/apache/calcite/pull/1057#discussion_r457042927



##########
File path: 
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java
##########
@@ -2194,7 +2193,14 @@ private Expression maybeBox(Expression expression) {
     @Override Expression implementSafe(RexToLixTranslator translator,
         RexCall call, List<Expression> argValueList) {
       final Expression argValue = argValueList.get(0);
-      final UnaryExpression e = Expressions.makeUnary(expressionType, 
argValue);
+
+      final Expression e;
+      if (expressionType == ExpressionType.Negate && argValue.type == 
BigDecimal.class) {
+        e = Expressions.call(BuiltInMethod.DECIMAL_NEGATE.method, argValue);

Review comment:
       According to Julian's suggestion, we can use `Expressions.call(argValue, 
"negate")` directly here, and do not need extra functions.




----------------------------------------------------------------
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]


Reply via email to