brancz commented on code in PR #9007:
URL: https://github.com/apache/arrow-rs/pull/9007#discussion_r2626346391
##########
arrow-cast/src/cast/mod.rs:
##########
@@ -1255,7 +1263,25 @@ pub fn cast_with_options(
let column = array.column(from_field_idx);
cast_with_options(column, to_field.data_type(),
cast_options)
})
- .collect::<Result<Vec<ArrayRef>, ArrowError>>()?
+ .collect::<Result<Vec<ArrayRef>, ArrowError>>()
+ {
+ Ok(casted_fields) => casted_fields,
+ Err(e) => {
+ // If it's Field not found, we cast field by field
+ if !e.to_string().starts_with("Field '")
Review Comment:
I think recasting multiple times is the thing we should avoid at all cost. I
changed the approach a bit and I think I'm happy enough with this. Now the
worst thing that can happen is that we try to match names twice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]