Skip to content

Commit

Permalink
Core: Ignore split offsets when the last split offset is past the fil…
Browse files Browse the repository at this point in the history
…e length
  • Loading branch information
amogh-jahagirdar committed Oct 17, 2023
1 parent 069d930 commit f407974
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/main/java/org/apache/iceberg/BaseFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,12 @@ public ByteBuffer keyMetadata() {

@Override
public List<Long> splitOffsets() {
// If the last split offset is past the file size this means the split offsets are corrupted and
// should not be used
if (splitOffsets != null && splitOffsets[splitOffsets.length - 1] >= fileSizeInBytes) {
return null;
}

return ArrayUtil.toUnmodifiableLongList(splitOffsets);
}

Expand Down

0 comments on commit f407974

Please sign in to comment.