MCPcopy Create free account
hub / github.com/apache/datafusion / column_unnests_eq

Function column_unnests_eq

datafusion/sql/src/utils.rs:714–734  ·  view source on GitHub ↗
(
        l: Vec<&str>,
        r: &IndexMap<Column, Option<Vec<ColumnUnnestList>>>,
    )

Source from the content-addressed store, hash-verified

712 use indexmap::IndexMap;
713
714 fn column_unnests_eq(
715 l: Vec<&str>,
716 r: &IndexMap<Column, Option<Vec<ColumnUnnestList>>>,
717 ) {
718 let r_formatted: Vec<String> = r
719 .iter()
720 .map(|i| match i.1 {
721 None => format!("{}", i.0),
722 Some(vec) => format!(
723 "{}=>[{}]",
724 i.0,
725 vec.iter()
726 .map(|i| format!("{i}"))
727 .collect::<Vec<String>>()
728 .join(", ")
729 ),
730 })
731 .collect();
732 let l_formatted: Vec<String> = l.iter().map(|i| (*i).to_string()).collect();
733 assert_eq!(l_formatted, r_formatted);
734 }
735
736 #[test]
737 fn test_transform_bottom_unnest_recursive() -> Result<()> {

Calls 4

collectMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45
to_stringMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…