Suppose a schema like this - a union of a map and a record:
[
{"type": "map", "values": "int"},
{"type": "record", "name": "Record", fields: [{"name": "field",
"type": "int"}]}
]
In Python, unserialized maps and records are both represented as
dictionaries. So, if an Avro Python library were asked to encode this
message:
{"field": 1}
What should it do? Should it describe the value as the map type, or
the record type, when encoding the union?
Similarly, I wonder about cases where multiple records are in a union.
I think it's easy to imagine the ambiguous cases without spelling it
all out.
Maybe this ambiguity is specific to the Python implementation, I'm not sure.