@@ -661,7 +661,7 @@ pub(crate) fn collect_non_nullable_fields(schema: &Schema) -> Vec<ColumnName> {
661661 let mut non_nullable_paths = Vec :: new ( ) ;
662662
663663 for field in schema. fields ( ) {
664- let path = vec ! [ field. name( ) . to_string ( ) ] ;
664+ let path = vec ! [ field. name( ) ] ;
665665 collect_non_nullable_fields_recursive ( field, path, & mut non_nullable_paths) ;
666666 }
667667
@@ -671,7 +671,7 @@ pub(crate) fn collect_non_nullable_fields(schema: &Schema) -> Vec<ColumnName> {
671671/// Recursively collect non-nullable field paths.
672672fn collect_non_nullable_fields_recursive (
673673 field : & Field ,
674- current_path : Vec < String > ,
674+ current_path : Vec < & String > ,
675675 non_nullable_paths : & mut Vec < ColumnName > ,
676676) {
677677 // If this field is non-nullable, add it to the collection
@@ -684,21 +684,16 @@ fn collect_non_nullable_fields_recursive(
684684 DataType :: Struct ( fields) => {
685685 for child in fields. iter ( ) {
686686 let mut child_path = current_path. clone ( ) ;
687- child_path. push ( child. name ( ) . to_string ( ) ) ;
687+ child_path. push ( child. name ( ) ) ;
688688 collect_non_nullable_fields_recursive ( child, child_path, non_nullable_paths) ;
689689 }
690690 }
691- // DataType::List(child) | DataType::LargeList(child) => {
692- // let mut child_path = current_path.clone();
693- // child_path.push("element".to_string());
694- // collect_non_nullable_fields_recursive(child, child_path, non_nullable_paths);
695- // }
696691 DataType :: Map ( child, _) => {
697692 // Map's child is a struct with "key" and "value" fields
698693 if let DataType :: Struct ( fields) = child. data_type ( ) {
699694 for map_field in fields. iter ( ) {
700695 let mut map_path = current_path. clone ( ) ;
701- map_path. push ( map_field. name ( ) . to_string ( ) ) ;
696+ map_path. push ( map_field. name ( ) ) ;
702697 collect_non_nullable_fields_recursive ( map_field, map_path, non_nullable_paths) ;
703698 }
704699 }
0 commit comments