Skip to content

refactor: widen GroupColumn::vectorized_equal_to to &mut self - #25238

Merged
jayzhan211 merged 1 commit into
apache:mainfrom
Rich-T-kid:rich-T-kid/vectorized-equal-to-mut-self
Sep 12, 2026
Merged

jayzhan211 merged 1 commit into
apache:mainfrom
Rich-T-kid:rich-T-kid/vectorized-equal-to-mut-self

Conversation

@Rich-T-kid

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Mechanical signature change across the trait and all 8 impls as the first step toward letting DictionaryGroupValuesColumn reuse its cached val_to_inner map in vectorized_equal_to instead of rebuilding it per batch (#25219).

What changes are included in this PR?

&self -> &mut self

What is the testing strategy for this PR?

n/a

Are there any user-facing changes?

no

@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Sep 12, 2026
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

@jayzhan211 could you take a look. I split this off from the dictionary specific refactor so that it can remain focused

@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Thank you for opening this pull request!

Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch).

Details
     Cloning apache/main
    Building datafusion-physical-plan v55.0.0 (current)
       Built [  39.774s] (current)
     Parsing datafusion-physical-plan v55.0.0 (current)
      Parsed [   0.157s] (current)
    Building datafusion-physical-plan v55.0.0 (baseline)
       Built [  38.866s] (baseline)
     Parsing datafusion-physical-plan v55.0.0 (baseline)
      Parsed [   0.157s] (baseline)
    Checking datafusion-physical-plan v55.0.0 -> v55.0.0 (no change; assume patch)
     Checked [   0.692s] 223 checks: 222 pass, 1 fail, 0 warn, 31 skip

--- failure trait_method_receiver_ref_became_mut: trait method receiver changed from immutable to mutable reference ---

Description:
A trait method's receiver changed from an immutable reference to a mutable one.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_method_receiver_ref_became_mut.ron

Failed in:
  datafusion_physical_plan::aggregates::group_values::multi_group_by::GroupColumn::vectorized_equal_to now takes &mut Self, not &Self, in /home/runner/work/datafusion/datafusion/datafusion/physical-plan/src/aggregates/group_values/multi_group_by/mod.rs:89

     Summary semver requires new major version: 1 major and 0 minor checks failed
    Finished [  81.025s] datafusion-physical-plan

@github-actions github-actions Bot added the auto detected api change Auto detected API change label Sep 12, 2026
Mechanical signature change across the trait and all 8 impls as the
first step toward letting `DictionaryGroupValuesColumn` reuse its
cached `val_to_inner` map in `vectorized_equal_to` instead of
rebuilding it per batch (apache#25219).

`GroupValuesColumns::vectorized_equal_to` switches to `iter_mut` and
uses `mem::replace` to temporarily extract the index slices from
`vectorized_operation_buffers`, avoiding a split-borrow conflict.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/vectorized-equal-to-mut-self branch from 45714e9 to ecff530 Compare September 12, 2026 19:02
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.94%. Comparing base (f8cc678) to head (ecff530).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25238      +/-   ##
==========================================
+ Coverage   81.93%   81.94%   +0.01%     
==========================================
  Files        1133     1133              
  Lines      423529   423799     +270     
  Branches   423529   423799     +270     
==========================================
+ Hits       347028   347300     +272     
+ Misses      55910    55904       -6     
- Partials    20591    20595       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jayzhan211 jayzhan211 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Rich-T-kid

@jayzhan211
jayzhan211 added this pull request to the merge queue Sep 12, 2026
@jayzhan211

Copy link
Copy Markdown
Contributor

It would be nice to add short comment why &mut self is required for the next PR

Merged via the queue into apache:main with commit 9a1ad7c Sep 12, 2026
41 checks passed
Omega359 pushed a commit to Omega359/arrow-datafusion that referenced this pull request Oct 11, 2026
…ache#25238)

## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes apache#123` indicates that this PR will close issue apache#123.
-->

- works towards apache#25219.

## Rationale for this change

Mechanical signature change across the trait and all 8 impls as the
first step toward letting `DictionaryGroupValuesColumn` reuse its cached
`val_to_inner` map in `vectorized_equal_to` instead of rebuilding it per
batch (apache#25219).

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.

Please explain the problem you are trying to solve in terms of the
user-visible
behavior, rather than the implementation.

For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of
the
implementation. "COUNT(DISTINCT) returns wrong results when the column
contains
nulls" is the user-visible problem.
-->

## What changes are included in this PR?
`&self` -> `&mut self`
<!--
There is no need to duplicate the description in the issue here, but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

## What is the testing strategy for this PR?
n/a
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

Briefly describe how this PR is tested, and point to the specific tests
you added. For example: 'This new feature is covered by the
`sqllogictest` cases added in `foo.slt`'.

If this PR does not add tests, explain why. For example, if the change
is already covered by existing tests, please mention it.

You should also check the `codecov` bot reply on this PR to confirm the
changed code is exercised.
-->

## Are there any user-facing changes?
no
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please add the `api
change` label.
-->

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto detected api change Auto detected API change physical-plan Changes to the physical-plan crate v56.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants