anuragmantri commented on code in PR #16285:
URL: https://github.com/apache/iceberg/pull/16285#discussion_r3737852004
##########
core/src/main/java/org/apache/iceberg/TrackingBuilder.java:
##########
@@ -115,6 +118,17 @@ TrackingBuilder dvUpdated() {
return this;
}
+ /** Indicates that the column files list has been updated for the new
Tracking. */
+ TrackingBuilder columnFilesUpdated() {
+ this.latestColumnFileSnapshotId = newSnapshotId;
+ if (status == EntryStatus.EXISTING) {
+ this.status = EntryStatus.MODIFIED;
+ }
+ // Bumping 'dataSequenceNumber' to avoid having both equality deletes and
column files.
Review Comment:
Should this comment be?
```suggestion
// Clears dataSequenceNumber so it re-inherits from the manifest at read
time.
```
##########
core/src/test/java/org/apache/iceberg/TestTrackingBuilder.java:
##########
@@ -272,15 +287,69 @@ void manifestDVPositionsProduceModified() {
assertThat(modified.deletedPositions()).isEqualTo(deletedBytes);
}
+ @Test
+ void manifestPositionsWithColumnFilesUpdated() {
+ ByteBuffer deletedBytes = ByteBuffer.wrap(new byte[] {1});
+ Tracking withDeletedPositions =
+ TrackingBuilder.from(manifestSourceTracking(), 999L)
+ .columnFilesUpdated()
+ .deletedPositions(deletedBytes)
+ .build();
+
+ assertThat(withDeletedPositions.status()).isEqualTo(EntryStatus.MODIFIED);
+
assertThat(withDeletedPositions.latestColumnFileSnapshotId()).isEqualTo(999L);
+ assertThat(withDeletedPositions.dvSnapshotId()).isEqualTo(999L);
+
assertThat(withDeletedPositions.deletedPositions()).isEqualTo(deletedBytes);
+
Review Comment:
Should we verify the dataSequenceNumber is null?
```suggestion
assertThat(withDeletedPositions.dataSequenceNumber()).isNull();
```
Same on L314 and in `manifestPositionsWithColumnFilesUpdated()` test
--
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]