@@ -155,10 +155,10 @@ fn json_string_to_struct(arr: &Arc<dyn Array>, schema: &DataType) -> Result<Arra
155155 let mut struct_nulls = vec ! [ true ; num_rows] ;
156156
157157 // Parse each row
158- for row_idx in 0 ..num_rows {
158+ for ( row_idx, struct_null ) in struct_nulls . iter_mut ( ) . enumerate ( ) {
159159 if string_array. is_null ( row_idx) {
160160 // Null input -> null struct
161- struct_nulls [ row_idx ] = false ;
161+ * struct_null = false ;
162162 append_null_to_all_builders ( & mut field_builders) ;
163163 } else {
164164 let json_str = string_array. value ( row_idx) ;
@@ -168,20 +168,20 @@ fn json_string_to_struct(arr: &Arc<dyn Array>, schema: &DataType) -> Result<Arra
168168 Ok ( json_value) => {
169169 if let serde_json:: Value :: Object ( obj) = json_value {
170170 // Struct is not null, extract each field
171- struct_nulls [ row_idx ] = true ;
171+ * struct_null = true ;
172172 for ( field, builder) in fields. iter ( ) . zip ( field_builders. iter_mut ( ) ) {
173173 let field_value = obj. get ( field. name ( ) ) ;
174174 append_field_value ( builder, field, field_value) ?;
175175 }
176176 } else {
177177 // Not an object -> struct with null fields
178- struct_nulls [ row_idx ] = true ;
178+ * struct_null = true ;
179179 append_null_to_all_builders ( & mut field_builders) ;
180180 }
181181 }
182182 Err ( _) => {
183183 // Parse error -> struct with null fields (PERMISSIVE mode)
184- struct_nulls [ row_idx ] = true ;
184+ * struct_null = true ;
185185 append_null_to_all_builders ( & mut field_builders) ;
186186 }
187187 }
0 commit comments