ApacheWang commented on PR #12533:
URL: https://github.com/apache/arrow-rs/pull/12533#issuecomment-7368583333

   Good suggestions, thanks @Jefffrey! Updated in `8a8d135`:
   
   - Gated the `filter` + `cast` + `take` path to strict casts where a 
conversion actually happens (`!cast_options.safe && values.data_type() != to`).
   - For safe casts and same-type unwraps, cast directly and apply parent nulls 
via `apply_null_mask`:
     - `DataType::Null`: return as-is without attaching a null buffer.
     - `DataType::RunEndEncoded(_, _) | DataType::Union(_, _)`: fall back to 
`take` with null indices.
     - All other types: combine directly with `NullBuffer::union(Some(nulls), 
values.nulls())` and `ArrayDataBuilder::nulls(...)` without copying element 
buffers.
   - Expanded `test_cast_single_element_fixed_size_list_preserves_nulls` to 
cover sliced same-type unwraps, safe and strict dictionary casts, `NullArray` 
unwraps, and strict cast failures on invalid values in valid rows.
   


-- 
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]

Reply via email to