stevenzwu commented on code in PR #13780:
URL: https://github.com/apache/iceberg/pull/13780#discussion_r2279956639


##########
core/src/main/java/org/apache/iceberg/SchemaParser.java:
##########
@@ -197,7 +197,12 @@ private static Type typeFromJson(JsonNode json) {
 
   private static Literal<?> defaultFromJson(String defaultField, Type type, 
JsonNode json) {
     if (json.has(defaultField)) {
-      return Expressions.lit(SingleValueParser.fromJson(type, 
json.get(defaultField)));
+      Object value = SingleValueParser.fromJson(type, json.get(defaultField));
+      if (type instanceof Types.TimestampNanoType) {
+        return Expressions.nanos((long) value);

Review Comment:
   yes, this is not an issue. the spec says
   ```
   Non-null values for initial-default or write-default are invalid.
   ```
   
   Earlier, I wasn't sure if null values are allowed for the default attributes.



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