rokadepiyush49-rgb commented on issue #11939:
URL: https://github.com/apache/arrow-rs/issues/11939#issuecomment-7112447612
With `safe: true`, failed conversions get written as `Variant::Null`, so the
row stays valid. Arrow's own cast kernels mark them as real nulls instead:
```mermaid
flowchart TD
A[cast_to_variant, safe = true] --> B{value converts?}
B -- yes --> C[Variant value]
B -- no, today --> D[Variant::Null, row valid]
B -. no, fix .-> E[Arrow null, validity unset]
```
The fix looks like appending a null on the builder in the safe-failure
branches of `arrow_to_variant.rs`, keeping `safe: false` as an error and real
JSON nulls as `Variant::Null`. Should this be called out as a breaking change
in the changelog?
--
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]