Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/iceberg/BaseFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public Object get(int i) {
case 16:
return sortOrderId;
case 17:
return pos;
return fileOrdinal;
default:
throw new UnsupportedOperationException("Unknown field ordinal: " + pos);
}
Expand Down
2 changes: 2 additions & 0 deletions core/src/test/java/org/apache/iceberg/TestManifestReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void testDataFilePositions() throws IOException {
long expectedPos = 0L;
for (DataFile file : reader) {
Assert.assertEquals("Position should match", (Long) expectedPos, file.pos());
Assert.assertEquals("Position from field index should match", expectedPos, ((BaseFile) file).get(17));
expectedPos += 1;
}
}
Expand All @@ -141,6 +142,7 @@ public void testDeleteFilePositions() throws IOException {
long expectedPos = 0L;
for (DeleteFile file : reader) {
Assert.assertEquals("Position should match", (Long) expectedPos, file.pos());
Assert.assertEquals("Position from field index should match", expectedPos, ((BaseFile) file).get(17));
expectedPos += 1;
}
}
Expand Down