Skip to content

Commit 3e006c9

Browse files
fix: reborrow metadata values when intersecting union metadata (#22491)
## Which issue does this PR close? - Closes #22488. ## 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.
1 parent d9ea38b commit 3e006c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

datafusion/expr/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ pub fn intersect_metadata_for_union<'a>(
662662
}
663663
Some(current) => {
664664
// Only keep keys that exist in both with the same value
665-
current.retain(|k, v| metadata.get(k) == Some(v));
665+
current.retain(|k, v| metadata.get(k) == Some(&*v));
666666
}
667667
}
668668
}

0 commit comments

Comments
 (0)