aokolnychyi commented on code in PR #9251: URL: https://github.com/apache/iceberg/pull/9251#discussion_r1425379313
########## core/src/main/java/org/apache/iceberg/DeleteFileIndex.java: ########## @@ -582,97 +524,214 @@ private Iterable<CloseableIterable<ManifestEntry<DeleteFile>>> deleteManifestRea } } - // a group of indexed delete files sorted by the sequence number they apply to - private static class DeleteFileGroup { - private final long[] seqs; - private final IndexedDeleteFile[] files; - - DeleteFileGroup(IndexedDeleteFile[] files) { - this.seqs = Arrays.stream(files).mapToLong(IndexedDeleteFile::applySequenceNumber).toArray(); - this.files = files; + /** + * Finds an index in the sorted array of sequence numbers where the given sequence number should + * be inserted or is found. + * + * <p>If the sequence number is present in the array, this method returns the index of the first + * occurrence of the sequence number. If the sequence number is not present, the method returns + * the index where the sequence number would be inserted while maintaining the sorted order of the + * array. This returned index ranges from 0 (inclusive) to the length of the array (inclusive). + * + * <p>This method is used to determine the subset of delete files that apply to a given data file. + * + * @param seqs an array of sequence numbers sorted in ascending order + * @param seq the sequence number to search for + * @return the index of the first occurrence or the insertion point + */ + private static int findStartIndex(long[] seqs, long seq) { Review Comment: The content of this method is just copied as it was. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org