Skip to content

Commit

Permalink
Minor: remove string copy from Column::from_qualified_name (apache#10947
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alamb authored and findepi committed Jul 16, 2024
1 parent 7f8ed5b commit a7c7f82
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions datafusion/common/src/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,21 @@ impl Column {
/// `foo.BAR` would be parsed to a reference to relation `foo`, column name `bar` (lower case)
/// where `"foo.BAR"` would be parsed to a reference to column named `foo.BAR`
pub fn from_qualified_name(flat_name: impl Into<String>) -> Self {
let flat_name: &str = &flat_name.into();
Self::from_idents(&mut parse_identifiers_normalized(flat_name, false))
let flat_name = flat_name.into();
Self::from_idents(&mut parse_identifiers_normalized(&flat_name, false))
.unwrap_or_else(|| Self {
relation: None,
name: flat_name.to_owned(),
name: flat_name,
})
}

/// Deserialize a fully qualified name string into a column preserving column text case
pub fn from_qualified_name_ignore_case(flat_name: impl Into<String>) -> Self {
let flat_name: &str = &flat_name.into();
Self::from_idents(&mut parse_identifiers_normalized(flat_name, true))
let flat_name = flat_name.into();
Self::from_idents(&mut parse_identifiers_normalized(&flat_name, true))
.unwrap_or_else(|| Self {
relation: None,
name: flat_name.to_owned(),
name: flat_name,
})
}

Expand Down

0 comments on commit a7c7f82

Please sign in to comment.