brancz commented on code in PR #9007:
URL: https://github.com/apache/arrow-rs/pull/9007#discussion_r2624512232
##########
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 don't love this, let me know if you have a better idea. The only other
idea I had was to build a hashmap of indexes and field names first, but didn't
like that because I didn't want to introduce allocations.
--
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]