Commits


Felipe Oliveira Carvalho authored and GitHub committed 48294b0790e
GH-34893: [C++] Fix run-end encoded array iterator issues that manifest on backwards iteration (#34896) ### Rationale for this change The value of `RunEndEncodedArraySpan::Iterator::physical_pos_` from the instance returned by `RunEndEncodedArraySpan::end()` is smaller (by 1) than the results of successive applications of `operator++()` until `logical_pos_` reaches the logical length of the run-end encoded array. To support backwards iteration, the `Iterator` returned by `RunEndEncodedArraySpan::end()` should be well-formed. There was no `operator--()` in `RunEndEncodedArraySpan::Iterator` before this PR, so one can't go backwards from `end()` and this latent bug doesn't manifest. ### What changes are included in this PR? - Addition of `RunEndEncodedArraySpan::Iterator::operator--()` - Addition of `MergedRunsIterator::operator--()` - Rename `isEnd()` to `is_end()` (it was a code-style violation) - More test cases ### Are these changes tested? By existing and new unit tests. ### Are there any user-facing changes? A public function -- `isEnd` -- was renamed, but this code hasn't been released yet, so it's OK. * Closes: #34893 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>