rdblue commented on code in PR #16936:
URL: https://github.com/apache/iceberg/pull/16936#discussion_r4200340910
##########
core/src/test/java/org/apache/iceberg/TestTrackedFileAdapters.java:
##########
@@ -671,6 +729,399 @@ void unknownSpecIdThrows() {
.hasMessageContaining("Cannot find partition spec for spec ID");
}
+ @Test
+ void dataTrackedFileAdapterHasNoTracking() {
+ TrackedFile result =
TrackedFileAdapters.forDataFile(TABLE_SCHEMA).wrap(DATA_FILE);
+
+ assertThat(result.tracking()).isNull();
+ assertWrappedDataFileMatchesFileFields(result, DATA_FILE);
+ assertThatThrownBy(result::formatVersion)
+ .isInstanceOf(IllegalStateException.class)
+ .hasMessage("Format version is assigned at write time");
+ }
+
+ @Test
+ void dataTrackedFileAdapterFromAddedManifestEntry() {
+ TrackedFile result =
TrackedFileAdapters.forDataFile(TABLE_SCHEMA).wrap(addedEntry(DATA_FILE));
+
+ assertThat(result.tracking().status()).isEqualTo(EntryStatus.ADDED);
+ assertThat(result.tracking().snapshotId()).isEqualTo(SNAPSHOT_ID);
+ assertThat(result.tracking().dataSequenceNumber()).isNull();
+ assertThat(result.tracking().fileSequenceNumber()).isNull();
+ assertThat(result.tracking().firstRowId()).isNull();
+ assertManifestPosition(result.tracking(), DATA_FILE);
+ assertWrappedDataFileMatchesFileFields(result, DATA_FILE);
+ }
+
+ @Test
+ void dataTrackedFileAdapterFromAddedManifestEntryWithNullSnapshotId() {
Review Comment:
I don't think this is needed. We know from other tests that the snapshot ID
is plumbed through correctly. We don't need to validate that it is plumbed
correctly when it takes a specific value (null).
--
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]