rdblue commented on code in PR #14502:
URL: https://github.com/apache/iceberg/pull/14502#discussion_r2709310423
##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -343,11 +343,15 @@ public String toString() {
// changes are carried through until metadata is read from a file
this.changes = changes;
- this.snapshotsById = indexAndValidateSnapshots(snapshots,
lastSequenceNumber);
+ this.snapshotsById =
+ this.snapshots != null
+ ? indexAndValidateSnapshots(this.snapshots, lastSequenceNumber)
+ : ImmutableMap.of();
Review Comment:
I think that there should never be a case where `snapshots` is null. I'd
probably keep that assumption in the code and, if anything, just add a check in
the constructor that the list is valid.
--
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]