zstan commented on code in PR #13274:
URL: https://github.com/apache/ignite/pull/13274#discussion_r3530945252


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java:
##########
@@ -1334,23 +1349,26 @@ private static class UnaryImplementor extends 
AbstractRexCallImplementor {
         /** {@inheritDoc} */
         @Override Expression implementSafe(RexToLixTranslator translator,
             RexCall call, List<Expression> argValueList) {
-            final Expression argVal = argValueList.get(0);
+            final Expression argValue = argValueList.get(0);
 
             final Expression e;
             //Special case for implementing unary minus with BigDecimal type
             //for other data type(except BigDecimal) '-' operator is OK, but 
for
             //BigDecimal, we should call negate method of BigDecimal
-            if (expressionType == ExpressionType.Negate && argVal.type == 
BigDecimal.class
-                && null != backupMethodName)
-                e = Expressions.call(argVal, backupMethodName);
-            else
-                e = IgniteExpressions.makeUnary(expressionType, argVal);
+            if (expressionType == ExpressionType.Negate && argValue.type == 
BigDecimal.class
+                && null != backupMethodName) {
+                e = Expressions.call(argValue, backupMethodName);
+            } else if (expressionType == NegateChecked && null != 
backupMethodName) {
+                e = Expressions.call(SqlFunctions.class, backupMethodName, 
argValueList);

Review Comment:
   we need to have a possibility easily compare current and our runtime 
implementations - for such a case we need disable checkstyle for whole file



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to