@@ -177,7 +177,8 @@ impl CastExpr {
177177 }
178178
179179 fn preserves_child_field_semantics ( & self , input_schema : & Schema ) -> Result < bool > {
180- Ok ( self . resolved_target_field ( input_schema) ? == self . expr . return_field ( input_schema) ?)
180+ Ok ( self . resolved_target_field ( input_schema) ?
181+ == self . expr . return_field ( input_schema) ?)
181182 }
182183
183184 /// Check if casting from the specified source type to the target type is a
@@ -347,7 +348,9 @@ pub(crate) fn cast_with_target_field_and_options(
347348 cast_options. clone ( ) ,
348349 ) ;
349350
350- if expr_type == * cast_type && candidate. preserves_child_field_semantics ( input_schema) ? {
351+ if expr_type == * cast_type
352+ && candidate. preserves_child_field_semantics ( input_schema) ?
353+ {
351354 return Ok ( Arc :: clone ( & expr) ) ;
352355 }
353356
@@ -930,15 +933,15 @@ mod tests {
930933 #[ test]
931934 fn field_aware_same_type_cast_preserves_explicit_target_field ( ) -> Result < ( ) > {
932935 let schema = Schema :: new ( vec ! [ Field :: new( "a" , Int32 , false ) ] ) ;
933- let expr = cast_with_target_field_and_options (
934- col ( "a" , & schema ) ? ,
935- & schema,
936- Arc :: new ( Field :: new ( "logical_a" , Int32 , true ) . with_metadata ( HashMap :: from ( [ (
937- "target_meta" . to_string ( ) ,
938- " 1". to_string ( ) ,
939- ) ] ) ) ) ,
940- None ,
941- ) ?;
936+ let expr =
937+ cast_with_target_field_and_options (
938+ col ( "a" , & schema) ? ,
939+ & schema ,
940+ Arc :: new ( Field :: new ( "logical_a" , Int32 , true ) . with_metadata (
941+ HashMap :: from ( [ ( "target_meta" . to_string ( ) , " 1". to_string ( ) ) ] ) ,
942+ ) ) ,
943+ None ,
944+ ) ?;
942945
943946 let cast_expr = expr
944947 . as_any ( )
0 commit comments