nastra commented on code in PR #19279:
URL: https://github.com/apache/iceberg/pull/19279#discussion_r4782683953


##########
core/src/main/java/org/apache/iceberg/SingleValueParser.java:
##########
@@ -72,17 +72,11 @@ public static Object fromJson(Type type, JsonNode 
defaultValue) {
         return defaultValue.longValue();
       case FLOAT:
         Preconditions.checkArgument(
-            defaultValue.isFloatingPointNumber(),
-            "Cannot parse default as a %s value: %s",
-            type,
-            defaultValue);
+            defaultValue.isNumber(), "Cannot parse default as a %s value: %s", 
type, defaultValue);

Review Comment:
   this is a similar issue to https://github.com/apache/iceberg/pull/19143 and 
I appreciate that you limited the fix to `SingleValueParser.fromJSON`. Also the 
fix makes sense to me.
   The one tiny behavioral change here is that this would now accept very large 
integer values and overflow, so maybe we should protect this by checking for 
`.isNumber` and then also `Float.isFinite()` and to the same for the DOUBLE 
case via `Double.isFinite()`



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

Reply via email to