rdblue commented on code in PR #5913:
URL: https://github.com/apache/iceberg/pull/5913#discussion_r989565406
##########
core/src/main/java/org/apache/iceberg/V2Metadata.java:
##########
@@ -310,19 +310,24 @@ public Object get(int i) {
case 1:
return wrapped.snapshotId();
case 2:
- if (wrapped.sequenceNumber() == null) {
- // if the entry's sequence number is null, then it will inherit
the sequence number of
- // the current commit.
+ if (wrapped.dataSequenceNumber() == null) {
+ // if the entry's data sequence number is null,
+ // then it will inherit the sequence number of the current commit.
// to validate that this is correct, check that the snapshot id is
either null (will
- // also be inherited) or
- // that it matches the id of the current commit.
+ // also be inherited) or that it matches the id of the current
commit.
Preconditions.checkState(
wrapped.snapshotId() == null ||
wrapped.snapshotId().equals(commitSnapshotId),
"Found unassigned sequence number for an entry from snapshot:
%s",
wrapped.snapshotId());
+
+ // inheritance should work only for ADDED entries
+ Preconditions.checkState(
Review Comment:
This sounds good to me.
--
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]