Skip to content

GH-50601: [C++] Refactor TranslateTo for clearer semantics - #50602

Merged
pitrou merged 1 commit into
apache:mainfrom
taepper:50601-refactor-translateto
Jul 22, 2026
Merged

GH-50601: [C++] Refactor TranslateTo for clearer semantics#50602
pitrou merged 1 commit into
apache:mainfrom
taepper:50601-refactor-translateto

Conversation

@taepper

@taepper taepper commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Follow-up to #50247

GenericNullLikePartition::TranslateTo translates a partition result from a source range to a target range. This includes pointer arithmetic and does not allow bounds checking for the source and target range, as only the range starts are given. Ideally, we want to pass the entire source and target range to the function, which will allow us to both validate sizes, guarantee that the correct source range is passed, and the resulting GenericNullLikePartition will point into the target range.

What changes are included in this PR?

Additional refactor for GenericNullLikePartition::TranslateTo, that now allows more DCHECKs. Each caller already had a std::span object for both source and target, which is now passed in directly.

Are these changes tested?

Re-ran existing test-suite.

Are there any user-facing changes?

No.

@taepper
taepper requested a review from pitrou as a code owner July 22, 2026 12:09
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50601 has been automatically assigned in GitHub to PR creator.

@pitrou pitrou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super, thank you for this!

@pitrou pitrou changed the title GH-50601: [C++] refactor TranslateTo for clearer semantics GH-50601: [C++] Refactor TranslateTo for clearer semantics Jul 22, 2026
@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jul 22, 2026
@pitrou
pitrou merged commit 0973268 into apache:main Jul 22, 2026
60 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Jul 22, 2026
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 0973268.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

@taepper
taepper deleted the 50601-refactor-translateto branch July 27, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants