You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "wiedld (via GitHub)" <gi...@apache.org> on 2025/08/19 22:30:50 UTC
Re: [PR] Add documentation for UNION schema handling. [datafusion]
wiedld commented on code in PR #17248:
URL: https://github.com/apache/datafusion/pull/17248#discussion_r2286487449
##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -2896,16 +2899,7 @@ impl Union {
fn intersect_maps<'a>(
inputs: impl IntoIterator<Item = &'a HashMap<String, String>>,
) -> HashMap<String, String> {
- let mut inputs = inputs.into_iter();
- let mut merged: HashMap<String, String> = inputs.next().cloned().unwrap_or_default();
- for input in inputs {
- // The extra dereference below (`&*v`) is a workaround for https://github.com/rkyv/rkyv/issues/434.
- // When this crate is used in a workspace that enables the `rkyv-64` feature in the `chrono` crate,
- // this triggers a Rust compilation error:
- // error[E0277]: can't compare `Option<&std::string::String>` with `Option<&mut std::string::String>`.
- merged.retain(|k, v| input.get(k) == Some(&*v));
- }
- merged
+ intersect_for_union(inputs)
Review Comment:
Note that at construction, we handle the schema by intersection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org