ninglinLiu opened a new pull request, #11972:
URL: https://github.com/apache/arrow-rs/pull/11972

   ## Which part of this project does this PR touch?
   
   - [ ] arrow-integration-test
   - [ ] arrow-* crates
   - [ ] parquet
   - [x] parquet-variant(-compute/-json)
   - [ ] arrow-flight
   - [ ] object_store
   - [ ] Other
   
   ## What changes are included in this PR?
   
   `cast_to_variant_with_options` took an empty/all-null fast path before 
validating the input type. Empty and all-null `Duration` / `Interval` arrays 
(including nested in lists) therefore succeeded, while the same types with 
non-null values correctly failed. Type acceptance should not depend on batch 
contents.
   
   This PR builds the row builder first so unsupported (and nested unsupported) 
types are rejected, then keeps the all-null fast path.
   
   Fixes #11946
   
   ## Are these changes tested?
   
   - [x] Yes (unit regression for empty/all-null duration & interval, and 
nested list forms)
   - [ ] I need help writing tests
   - [ ] Existing tests cover this change
   
   How: `cargo test -p parquet-variant-compute cast_to_variant`
   
   ## Are there any user-facing changes?
   
   Yes — `cast_to_variant` / `cast_to_variant_with_options` now return 
`InvalidArgumentError` for empty and all-null duration/interval inputs (and 
lists of those), matching non-null behavior.


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