zabetak commented on code in PR #3326:
URL: https://github.com/apache/calcite/pull/3326#discussion_r1323112955
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java:
##########
@@ -774,10 +779,15 @@ public static Expression translateLiteral(
return Expressions.constant(bd, javaClass);
}
assert javaClass == BigDecimal.class;
- return Expressions.new_(BigDecimal.class,
- Expressions.constant(
+ Expression expression =
+ Expressions.new_(
+ BigDecimal.class, constant(
requireNonNull(bd,
() -> "value for " + literal).toString()));
+ if (type.getScale() != bd.scale()) {
+ expression = adjustDecimalScale(type.getScale(), expression);
+ }
+ return expression;
Review Comment:
I think we can keep the original proposal and deal with `-0.1:DECIMAL(19,0)`
in a follow-up.
--
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]