What's the default for merging in avro Idl?

For joins in avro Idl something like below, what would the default values ​​be?
 1. union {null, string} var = null;
 2. union {string, null} = "xyz";
 3. union {null, string} = "xyz";
 4. union {null, string, array} = [];

My guess is the defaults will always be the first item in the union. I understand correctly?

+3


source to share


1 answer


Ok, I found the answer (from apache user manual ).
The default union type will always be the first value. So here the default types for the above examples would be NULL, STRING, NULL and NULL. And the default values ​​will be those assigned to the union.



So in the above unions, only the first and second unions are syntactically correct, and I think all the other (3 and 4) unions are syntactically wrong because the default values ​​assigned to them do not match the default union type.

+1


source







All Articles