gaborkaszab commented on code in PR #16689:
URL: https://github.com/apache/iceberg/pull/16689#discussion_r3373490369
##########
core/src/main/java/org/apache/iceberg/EntryStatus.java:
##########
@@ -23,8 +23,12 @@ enum EntryStatus {
EXISTING(0),
ADDED(1),
DELETED(2),
- /** Indicates an entry that has been replaced by a column update or DV
change. Added in v4. */
- REPLACED(3);
+ /**
+ * The old (replaced) state of an entry that has been modified. Paired with
MODIFIED. Added in v4.
Review Comment:
I recall on the last V4 AMT sync there was an idea to make the leaf
manifests MODIFIED when adding a new DV, without having a corresponding
REPLACED entry. Not sure how far we got with that idea, but it seems to go
against the comments here, where the comments seem to be relevant for data
entries only.
##########
core/src/test/java/org/apache/iceberg/TestTrackingStruct.java:
##########
@@ -106,19 +106,13 @@ void testAllStatuses(EntryStatus status) {
@Test
void testIsLive() {
- TrackingStruct tracking = new TrackingStruct(Tracking.schema());
-
- tracking.set(STATUS_ORDINAL, EntryStatus.ADDED.id());
- assertThat(tracking.isLive()).isTrue();
-
- tracking.set(STATUS_ORDINAL, EntryStatus.EXISTING.id());
- assertThat(tracking.isLive()).isTrue();
-
- tracking.set(STATUS_ORDINAL, EntryStatus.DELETED.id());
- assertThat(tracking.isLive()).isFalse();
+ Tracking source = sourceTracking();
- tracking.set(STATUS_ORDINAL, EntryStatus.REPLACED.id());
- assertThat(tracking.isLive()).isFalse();
+ assertThat(TrackingBuilder.added(42L).build().isLive()).isTrue();
+ assertThat(TrackingBuilder.from(source, 999L).build().isLive()).isTrue();
+ assertThat(TrackingBuilder.from(source,
999L).dvUpdated().build().isLive()).isTrue();
Review Comment:
nit: maybe add an assert on the status of the entry too to make it easier
for the readers to understand which status is live and which one isn't?
--
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]