feat: add fragment range read to Java API#6490
Open
bryanck wants to merge 3 commits intolance-format:mainfrom
Open
feat: add fragment range read to Java API#6490bryanck wants to merge 3 commits intolance-format:mainfrom
bryanck wants to merge 3 commits intolance-format:mainfrom
Conversation
added 2 commits
April 12, 2026 18:45
bryanck
commented
Apr 13, 2026
| public class FragmentMetadata implements Serializable { | ||
| private static final long serialVersionUID = -5886811251944130460L; | ||
| private final int id; | ||
| private final int id; // FIXME: change to long |
Contributor
Author
There was a problem hiding this comment.
Fragment ID should be a long but that is a fairly significant change so left that for a follow up.
Contributor
Author
There was a problem hiding this comment.
I opened this follow up to move fragment ID to long... #6498
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR exposes a fragment range read method in the Java API. It adds a new
readRangemethod to the JavaFragmentclass that calls a new JNI native method. Currently the only way to read a range from a fragment is to use the dataset scanner, however the dataset scanner always callscount_all_rowson the dataset when bounds checking a range. That adds overhead to the operation.An alternative approach would be to add an option to disable the bounds check when using dataset scanner, but I felt this solution reflects the native API more closely.
Here's a CPU profile using dataset scanner (first) and fragment range read (second)...

