|
Hi all, I am working with two schemas and I have a question about compatibility in regards to nullable unions. Let’s say I have a record with a single union field. In Schema A, the first union may be null or a string. In schema B, the union may be null or an int. The record names are the same between the twos chemas.
According to avro spec section on Schema Resolution: if both are unions: The first schema in the reader's union that matches the selected writer's union schema is recursively resolved against it.
if none match, an error is signalled. Does this mean that Schema A and Schema B are compatible because both unions can be null even though the other type is not compatible between the two schemas? I would have expected that compatibility would
only be true if both types in a union matched between the two schemas. Thanks, Joe See schemas below. Schema A: { "type": "record", "namespace": "com.acme ", "name": "Outer", "fields": [ { "name": "inner", "type": [ "null", “string” ] } Schema B: { "type": "record", "namespace": "com.acme ", "name": "Outer", "fields": [ { "name": "inner", "type": [ "null", “int” ] } |
- Schema Compatibility and Nullable Unions Joseph Lorenzini
- Re: Schema Compatibility and Nullable ... Oscar Westra van Holthe - Kind
