bjchambers opened a new issue #782:
URL: https://github.com/apache/arrow-rs/issues/782
**Describe the bug**
`Schema::try_merge` seems to treat a field that exists (as non-nullable) in
one schema and not the other as non-nullable. I believe this leads to the
resulting schema not being able to represent rows from both original schemas,
since any rows in the second schema won't have the given field, thus it will be
null.
**To Reproduce**
```
let schema1 = Arc::new(Schema::new(vec![
Field::new("a", DataType::Int32, false),
Field::new("b", DataType::Int64, false),
]));
let schema2 = Arc::new(Schema::new(vec![
Field::new("a", DataType::Int32, false),
]));
let merged = Schema::try_merge(vec![schema1, schema2]).unwrap();
```
**Expected behavior**
I would expect either a schema containing only field `a` (lowest common
denominator between the schemas) or containing `a` and `b`, but with `b`
changed to be nullable. Either of these would allow the merged schema to be
used with files of any of the input schemas.
I believe the actual result is the same as `schema1` and thus doesn't work
with any rows coming from `schema2`.
**Additional context**
Add any other context about the problem here.
--
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]