Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Feb 18, 2025
1 parent 8e2be20 commit 3ae482c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/polars-plan/src/plans/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}))
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 3ae482c

Please sign in to comment.