feat(java): count indexed rows on explicit scalar segments - #9644
Open
hfutatzhanghb wants to merge 8 commits into
Open
hfutatzhanghb wants to merge 8 commits into
hfutatzhanghb wants to merge 8 commits into
Conversation
Pin countIndexedRows to the named scalar index and add an overload that opens only the requested physical segments. Selected segment coverage defines the count scope and must match an explicit fragment list.
Match guards are not exhaustive, so Rust 1.91 rejected the segment loader. Format the new indexed-count path with the repository rustfmt rules.
After fragment reuse, one source segment advertises every destination fragment while still depending on its siblings. Require every contributor for that scope so a partial UUID set cannot under-count.
Callers need to see that a fragment-reuse scope is accepted only when every contributing segment UUID is supplied.
Contributor
Author
|
Hi, @Xuanwo @wjones127 @BubbleCal Could you please help review this PR when have free time? Thanks very much! |
Legacy datasets count through MaterializeIndexExec, which opened every segment of the logical index. Pass the requested UUIDs into that loader.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Named-index counts now respect UUID selection on both modern and legacy storage, while retaining deletion filtering and the complete-contributor requirement after fragment reuse. Both earlier findings remain fixed.
The public Rust open_scalar_index_segments signature gains a parameter; the Java overload is additive. Please mark this PR with the breaking-change label.
This branch has not been deployed
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.
feat(java): count indexed rows on explicit scalar segments
Summary
Dataset.countIndexedRowsmethod to the named scalar index, and reject filters that cannot be planned against that index. The three-argument signature is unchanged. This corrects the method so it counts with the index it was given, rather than scanning or selecting another index.Test plan
./mvnw spotless:applyand./mvnw spotless:checkinjava/ScalarIndexTestcovers independent segment counts, A+B versus the full logical index, coverage mismatch, unknown and wrong-index UUIDs, duplicate and empty input, deletions, stable row IDs, and proof that an unselected segment file is not opened