rdblue commented on code in PR #12302:
URL: https://github.com/apache/iceberg/pull/12302#discussion_r1960084940


##########
api/src/main/java/org/apache/iceberg/types/Types.java:
##########
@@ -694,7 +698,10 @@ private static Literal<?> castDefault(Literal<?> 
defaultValue, Type type) {
         throw new IllegalArgumentException(
             String.format("Invalid default value for %s: %s (must be null)", 
type, defaultValue));
       } else if (defaultValue != null) {
-        return defaultValue.to(type);
+        Literal<?> typedDefault = defaultValue.to(type);

Review Comment:
   Right now, we make a lot of assumptions that Literal does not contain null 
or NaN. That way, we don't need to implement 3-value boolean logic or worry 
about how to handle NaN in comparisons.
   
   If you want to have a null default, then you don't set a default value for 
an optional column. And this also passes through null without a problem if the 
Literal was null.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to