You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/07/20 22:46:32 UTC

[GitHub] [calcite] julianhyde commented on a change in pull request #1057: [CALCITE-2854] Codegen compile error when implementing unary minus function with data type BigDecimal

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



##########
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(argValue, "negate");

Review comment:
       replace "negate" string here with a reference to a method in BuiltInMethod




----------------------------------------------------------------
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:
users@infra.apache.org