zhuqi-lucas opened a new pull request, #9524:
URL: https://github.com/apache/arrow-rs/pull/9524

   # Which issue does this PR close?
   
   Field::try_merge correctly handles DataType::Null for primitive types
   and when self is Null, but fails when self is a compound type (Struct,
   List, LargeList, Union) and from is Null. This causes Schema::try_merge
   to error when merging schemas where one has a Null field and another has a
   concrete compound type for the same field.
   
   This is common in JSON inference where some files have null values for
   fields that are structs/lists in other files.
   
   - Closes[ #9523](https://github.com/apache/arrow-rs/issues/9523)
   
   # Rationale for this change
   
   Add `DataType::Null` arms to the Struct, List, LargeList, and Union
   branches in `Field::try_merge`, consistent with how primitive types
   already handle it.
   
   # What changes are included in this PR?
   
   Add `DataType::Null` arms to the Struct, List, LargeList, and Union
   branches in `Field::try_merge`, consistent with how primitive types
   already handle it.
   # Are these changes tested?
   
   - Added test `test_merge_compound_with_null` covering Struct, List,
     LargeList, and Union merging with Null in both directions.
   - Existing tests continue to pass.
   
   # Are there any user-facing changes?
   
   No


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