Roger created AVRO-2706: --------------------------- Summary: union reading does not use first matching member Key: AVRO-2706 URL: https://issues.apache.org/jira/browse/AVRO-2706 Project: Apache Avro Issue Type: Improvement Components: java Reporter: Roger
[Here|https://gist.github.com/rogpeppe/5faf971eec51f3dbd316bb71d6d5dccc] is a JSON representation of a test case that fails with the Java implementation of Avro. To reproduce on the command line with avro-tools, you'll need a version of avro-tools with https://github.com/apache/avro/pull/785 committed. I've used the name "avro" as a synonym for running the avro-tools jar under the Java VM: echo '{"F":{"int":999}}' | avro fromjson --schema '{"name":"R","type":"record","fields":[{"name":"F","type":["int","string"],"default":1234}]}' - | avro tojson --reader-schema '{"name":"R","type":"record","fields":[{"name":"F","type":["long","int","string"],"default":1234}]}' - This produces: {"F":{"int":999}} whereas I'd expect to see "long", because the first matching item in the union is "long". -- This message was sent by Atlassian Jira (v8.3.4#803005)