Fokko commented on code in PR #12335:
URL: https://github.com/apache/iceberg/pull/12335#discussion_r1968210910
##########
core/src/main/java/org/apache/iceberg/TableMetadataParser.java:
##########
@@ -216,9 +216,15 @@ public static void toJson(TableMetadata metadata,
JsonGenerator generator) throw
// write properties map
JsonUtil.writeStringMap(PROPERTIES, metadata.properties(), generator);
- generator.writeNumberField(
- CURRENT_SNAPSHOT_ID,
- metadata.currentSnapshot() != null ?
metadata.currentSnapshot().snapshotId() : -1);
+ if (metadata.currentSnapshot() != null) {
+ generator.writeNumberField(CURRENT_SNAPSHOT_ID,
metadata.currentSnapshot().snapshotId());
+ } else {
+ if (metadata.formatVersion() >= 3) {
Review Comment:
I missed this comment, but I've added it 👍
--
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]