zabetak commented on code in PR #3326:
URL: https://github.com/apache/calcite/pull/3326#discussion_r1304268195


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -6422,6 +6422,10 @@ private static void checkIf(SqlOperatorFixture f) {
       f.checkScalarApprox("atanh(0.76159416)", "DOUBLE NOT NULL",
           isWithin(1d, 0.0001d));
       f.checkScalarApprox("atanh(cast(-0.1 as decimal))", "DOUBLE NOT NULL",
+          isWithin(-0.0d, 0.0001d));

Review Comment:
   The SqlOperatorTest has a lot of test cases with casts to decimals etc that 
are currently disabled due to `SqlOperatorTest#DECIMAL` field. Are we planning 
to fix those as part of this PR? It looks like we should.
   
   Note that currently there is a bug (tracked under CALCITE-5923) and due to 
that `CalciteSqlOperatorTest` are not running as expected.



##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java:
##########
@@ -838,6 +848,13 @@ public static Expression translateLiteral(
     return Expressions.constant(value2, javaClass);
   }
 
+  private static MethodCallExpression adjustDecimalScale(int scale,
+      Expression expression) {
+    assert expression.getType() == BigDecimal.class;
+    return Expressions.call(expression, 
BuiltInMethod.BIG_DECIMAL_SET_SCALE.method,
+        Expressions.constant(scale), 
Expressions.constant(RoundingMode.HALF_UP));

Review Comment:
   As long as we are consistent with other places in Calcite that's fine with 
me.



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