klion26 commented on issue #8091: URL: https://github.com/apache/arrow-rs/issues/8091#issuecomment-3182305945
I'm trying to support this by enhancing the existing macro like below - add one more rule for the `VariantArray::value` - change the existing rule(add `builder => ` in the existing rule) ``` #[macro_export] macro_rules! cast_conversion { ($t:ty, $method:ident, $cast_fn:expr, $input:expr, builder => $builder:expr) => {{ let array = $input.$method::<$t>(); for i in 0..array.len() { if array.is_null(i) { $builder.append_null(); continue; } let cast_value = $cast_fn(array.value(i)); $builder.append_variant(Variant::from(cast_value)); } }}; ($t:ty, $method:ident, $cast_fn:expr, $input:expr, index => $index:expr) => {{ let array = $input.$method::<$t>(); let cast_value = $cast_fn(array.value($index)); Variant::from(cast_value) }}; } ``` -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org