rdblue commented on code in PR #5928:
URL: https://github.com/apache/iceberg/pull/5928#discussion_r989383675
##########
api/src/main/java/org/apache/iceberg/expressions/ExpressionUtil.java:
##########
@@ -291,7 +291,9 @@ private static String sanitize(Literal<?> literal) {
}
private static String sanitizeNumber(Number value, String type) {
- int numDigits = (int) Math.log10(value.doubleValue()) + 1;
+ // log10 of zero isn't defined and will result in negative infinity
+ int numDigits =
+ 0.0d == value.doubleValue() ? 1 : (int)
Math.log10(Math.abs(value.doubleValue())) + 1;
Review Comment:
Good point. Right now, this is summarizing the numeric value, even if that's
outside the range of actual digits we'd be able to store because of precision.
I think it's probably fine for now though?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]