GH-51289: [C++] Add iterator-based bit-run traversal - #51310
Open
akashchamp wants to merge 1 commit into
Open
Conversation
|
|
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.
Fixes #51289
Rationale for this change
The callback-based bit-run visitors require callers to route early termination through callback status handling. These ranges allow normal iterator control flow, including breaking once a caller has found the run it needs.
What changes are included in this PR?
IterateBitRuns,IterateSetBitRuns, andIterateTwoSetBitRunsas C++20 input ranges.BitRuntype and introducePositionedBitRunfor full bit runs so iterator values expose position, length, and set state.Are these changes tested?
clang-format --dry-run --Werrorandgit diff --checkarrow-bit-utility-test --gtest_filter='TestSetBitRunReader.Iterate*'(3 tests)arrow-bit-utility-test(217 tests) and its focused CTest entryAre there any user-facing changes?
No public API changes. This adds internal C++ traversal helpers for callers that need iterator control flow.
AI assistance
Assisted-by: Codex
AI assistance was used for the initial implementation and regression tests. I reviewed the final code, kept the change scoped to the requested API, and manually validated the behavior above.