xiedeyantu commented on code in PR #4537:
URL: https://github.com/apache/calcite/pull/4537#discussion_r2350434553
##########
core/src/main/java/org/apache/calcite/rex/RexLiteral.java:
##########
@@ -1290,6 +1291,14 @@ public static long longValue(RexNode node) {
return number.longValue();
}
+ /** Returns the value of a literal, cast, or unary minus, as a BigDecimal;
+ * never null. Uses {@link BigDecimal} for consistency with numeric literals
+ * and to facilitate precise comparison operations.*/
+ public static BigDecimal roundedValue(RexNode node) {
Review Comment:
Hi @julianhyde, Thanks for your reply! I'd like to confirm your question.
Are you saying that `roundedValue` should return a `Number` type? I've noticed
that comparing `Number` with `BigDecimal` or `BigInterger` still requires some
type conversion. Using methods like `Number`'s `longValue()` still risks
overflow. Could you clarify what needs improvement?
--
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]