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


##########
core/src/main/java/org/apache/iceberg/SingleValueParser.java:
##########
@@ -72,18 +72,24 @@ 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",
+            defaultValue.isNumber(), "Cannot parse default as a %s value: %s", 
type, defaultValue);
+        float floatValue = defaultValue.floatValue();
+        Preconditions.checkArgument(
+            Float.isFinite(floatValue),

Review Comment:
   Could the PR description mention this check? It covers fractional literals 
too: on `main` a float default of `1e39` or a double default of `1e400` [comes 
back as 
±Infinity](https://github.com/apache/iceberg/blob/82dd303d8527d804d20f79371dca0687dee810b5/core/src/main/java/org/apache/iceberg/SingleValueParser.java#L73-L86),
 and with this check 
[`SchemaParser`](https://github.com/apache/iceberg/blob/c6b4d48825668055c5ea51e07d7bd64a5e45db56/core/src/main/java/org/apache/iceberg/SchemaParser.java#L198-L200)
 now rejects that schema. Rejecting it seems right to me, but existing metadata 
reads differently now, so it should be in the squash message.



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