Skip to content

fix: reborrow metadata values when intersecting union metadata#22491

Open
officialasishkumar wants to merge 1 commit into
apache:mainfrom
officialasishkumar:fix/metadata-retain-reborrow
Open

fix: reborrow metadata values when intersecting union metadata#22491
officialasishkumar wants to merge 1 commit into
apache:mainfrom
officialasishkumar:fix/metadata-retain-reborrow

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

intersect_metadata_for_union compares values retained by HashMap::retain with values from another metadata map. The retained value is passed as &mut String, which can make Option equality ambiguous for downstream crates when additional blanket PartialEq implementations are in scope.

Reborrowing the retained value as &String keeps the comparison type explicit without changing behavior.

What changes are included in this PR?

The metadata retain predicate now compares metadata.get(k) with Some(&*v) instead of Some(v).

Are these changes tested?

Yes.

  • cargo test -p datafusion-expr intersect_metadata_tests
  • cargo fmt --all -- --check
  • git diff --check

Are there any user-facing changes?

No runtime behavior change. This avoids a downstream compilation failure in the reported dependency configuration.

@github-actions github-actions Bot added the logical-expr Logical plan and expressions label May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

intersect_metadata_for_union fails to typecheck when rkyv is in scope on rustc 1.91.1

1 participant