Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Next Next commit
Core: Always project manifest first_row_id.
  • Loading branch information
rdblue committed Apr 18, 2025
commit 306438985713ac15170935b64f19ba01f3ab7196
3 changes: 3 additions & 0 deletions core/src/main/java/org/apache/iceberg/ManifestReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ private CloseableIterable<ManifestEntry<F>> open(Schema projection) {
if (projection.findField(DataFile.RECORD_COUNT.fieldId()) == null) {
fields.add(DataFile.RECORD_COUNT);
}
if (projection.findField(DataFile.FIRST_ROW_ID.fieldId()) == null) {
fields.add(DataFile.FIRST_ROW_ID);
}
fields.add(MetadataColumns.ROW_POSITION);

CloseableIterable<ManifestEntry<F>> reader =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,9 @@ private static void checkDataFileAssignment(
try (ManifestReader<DataFile> reader =
ManifestFiles.read(manifest, table.io(), table.specs())) {

// test that the first_row_id column is always scanned, even if not requested
reader.select(BaseScan.SCAN_COLUMNS);

for (DataFile file : reader) {
assertThat(file.content()).isEqualTo(FileContent.DATA);
if (index < firstRowIds.length) {
Expand Down
Loading