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


##########
core/src/main/java/org/apache/iceberg/SchemaParser.java:
##########
@@ -92,6 +94,14 @@ private static void toJson(Types.StructType struct, Integer 
schemaId, Set<Intege
       if (field.doc() != null) {
         generator.writeStringField(DOC, field.doc());
       }
+      if (field.initialDefaultValue() != null) {
+        generator.writeFieldName(INITIAL_DEFAULT);
+        generator.writeRawValue(field.initialDefaultValue().toString());
+      }
+      if (field.writeDefaultValue() != null) {
+        generator.writeFieldName(WRITE_DEFAULT);
+        generator.writeRawValue(field.writeDefaultValue().toString());

Review Comment:
   Instead of using `toString` that produces JSON, I think that this should 
expose a `ValueParser` that converts values from the internal Iceberg 
representation into JSON values.



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