Describe the bug
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.
To Reproduce
Expected behavior
Add DataType::Null arms to the Struct, List, LargeList, and Union
branches in Field::try_merge, consistent with how primitive types
already handle it.
Additional context
Describe the bug
Field::try_mergecorrectly handlesDataType::Nullfor primitive typesand when
selfis Null, but fails whenselfis a compound type (Struct,List, LargeList, Union) and
fromis Null. This causesSchema::try_mergeto 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
nullvalues forfields that are structs/lists in other files.
To Reproduce
Expected behavior
Add
DataType::Nullarms to the Struct, List, LargeList, and Unionbranches in
Field::try_merge, consistent with how primitive typesalready handle it.
Additional context