RussellSpitzer commented on code in PR #4594:
URL: https://github.com/apache/iceberg/pull/4594#discussion_r858807243


##########
nessie/src/main/java/org/apache/iceberg/nessie/NessieTableOperations.java:
##########
@@ -139,15 +170,27 @@ protected void doCommit(TableMetadata base, TableMetadata 
metadata) {
       }
       Snapshot snapshot = metadata.currentSnapshot();
       long snapshotId = snapshot != null ? snapshot.snapshotId() : -1L;
+
+      JsonNode newMetadata;
+      try {
+        TokenBuffer tokenBuffer = new 
TokenBuffer(JsonUtil.factory().getCodec(), false);
+        TableMetadataParser.toJson(metadata, tokenBuffer);

Review Comment:
   So we could avoid this usage if we use the "toJson(metadata) method and then 
pass that into the token buffer. I know it's a bit more wasteful but we are 
only doing this once per operation and it let's us keep the toJson(metadata, 
generator) method package private. Again I may be being paranoid here but 
ideally we don't open up any more methods than we absolutely have to.



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