Skip to content

Commit 24bb5e5

Browse files
committed
inline and rename function
1 parent baa3f8d commit 24bb5e5

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

datafusion/expr/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ pub type SchemaFieldMetadata = std::collections::HashMap<String, String>;
642642
/// # Returns
643643
///
644644
/// A new `SchemaFieldMetadata` containing only the intersected metadata
645-
pub fn intersect_for_union<'a>(
645+
pub fn intersect_metadata_for_union<'a>(
646646
metadatas: impl IntoIterator<Item = &'a SchemaFieldMetadata>,
647647
) -> SchemaFieldMetadata {
648648
let mut metadatas = metadatas.into_iter();

datafusion/expr/src/logical_plan/plan.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use super::invariants::{
3232
use super::DdlStatement;
3333
use crate::builder::{change_redundant_column, unnest_with_options};
3434
use crate::expr::{
35-
intersect_for_union, Placeholder, Sort as SortExpr, WindowFunction,
35+
intersect_metadata_for_union, Placeholder, Sort as SortExpr, WindowFunction,
3636
WindowFunctionParams,
3737
};
3838
use crate::expr_rewriter::{
@@ -2802,7 +2802,7 @@ impl Union {
28022802

28032803
let mut field =
28042804
Field::new(name, data_type.clone(), final_is_nullable);
2805-
field.set_metadata(intersect_maps(unmerged_metadata));
2805+
field.set_metadata(intersect_metadata_for_union(unmerged_metadata));
28062806

28072807
(None, Arc::new(field))
28082808
},
@@ -2896,12 +2896,6 @@ impl Union {
28962896
}
28972897
}
28982898

2899-
fn intersect_maps<'a>(
2900-
inputs: impl IntoIterator<Item = &'a HashMap<String, String>>,
2901-
) -> HashMap<String, String> {
2902-
intersect_for_union(inputs)
2903-
}
2904-
29052899
// Manual implementation needed because of `schema` field. Comparison excludes this field.
29062900
impl PartialOrd for Union {
29072901
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {

0 commit comments

Comments
 (0)