You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "zabetak (via GitHub)" <gi...@apache.org> on 2023/09/12 14:01:45 UTC
[GitHub] [calcite] zabetak commented on a diff in pull request #3326: CALCITE-5860 Set scale when casting Decimal
zabetak commented on code in PR #3326:
URL: https://github.com/apache/calcite/pull/3326#discussion_r1323094279
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java:
##########
@@ -625,7 +627,10 @@ private static Expression checkExpressionPadTruncate(
default:
return operand;
}
-
+ case DECIMAL:
+ return sourceType.getScale() == targetType.getScale()
+ ? operand
+ : adjustDecimalScale(targetType.getScale(), operand);
Review Comment:
Agreed. The name of the method (`checkExpressionPadTruncate`) is a bit misleading but indeed it is a good place for the conversion.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org