From 3ae482ce1d308c8974c8a8854ceec10a24d79a6a Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Tue, 18 Feb 2025 23:13:32 +1100 Subject: [PATCH] c --- crates/polars-plan/src/plans/schema.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/polars-plan/src/plans/schema.rs b/crates/polars-plan/src/plans/schema.rs index 51a8ddd35376..c3c67cf3874a 100644 --- a/crates/polars-plan/src/plans/schema.rs +++ b/crates/polars-plan/src/plans/schema.rs @@ -291,14 +291,15 @@ pub(crate) fn det_join_schema( }))? // Columns from right .hstack(schema_right.iter().map(|(name, dtype)| { + suffixed = None; + let in_left_schema = schema_left.contains(name.as_str()); let is_coalesced = join_on_left.contains(name.as_str()); if in_left_schema && !is_coalesced { - suffixed.replace(format_pl_smallstr!("{}{}", name, options.args.suffix())); + suffixed = Some(format_pl_smallstr!("{}{}", name, options.args.suffix())); (suffixed.clone().unwrap(), dtype.clone()) } else { - suffixed = None; (name.clone(), dtype.clone()) } })) @@ -381,7 +382,7 @@ pub(crate) fn det_join_schema( let mut suffixed = None; let (name, dtype) = if schema_left.contains(name) { - suffixed.replace(format_pl_smallstr!("{}{}", name, options.args.suffix())); + suffixed = Some(format_pl_smallstr!("{}{}", name, options.args.suffix())); (suffixed.clone().unwrap(), dtype.clone()) } else { (name.clone(), dtype.clone())