Commits


Ben Harkins authored and GitHub committed 0dfec8e98f4
ARROW-18106: [C++] JSON reader ignores explicit schema with default unexpected_field_behavior="infer" (#14741) See: [ARROW-18106](https://issues.apache.org/jira/browse/ARROW-18106) The current `ChunkedArrayBuilder` always uses the promotion graph for type conversions if it's provided (even for fields in the explicit schema). The bug in question occurs because conversion errors aren't propagated in `InferringChunkedArrayBuilder`. Instead, it will attempt to promote the type on failure, which is undesirable in cases like this. This PR doesn't change any of that. It only restricts type inference to unexpected fields while fields present in the schema remain "strongly-typed" - so conversion errors for expected fields will still be reported if `UnexpectedFieldBehavior::InferType` is specified. Authored-by: benibus <bpharks@gmx.com> Signed-off-by: Antoine Pitrou <antoine@python.org>