For unions in avro Idl something like below what would be the default values?
1. union {null, string} var = null;
2. union {string, null} = "xyz";
3. union {null, string} = "xyz";
4. union {null, string, array} = [];
My assumption is the default values would be always the first item in the union. Is my understand correct?
okay, I found the answer (from the apache user guide).
The default type of an union will be always it's first value. So, here the default types for the above examples would be NULL, STRING, NULL and NULL. And the default values would be the ones those assigned to the union.
So, in the above unions only the first and second unions are syntactically correct and I think all other (3 and 4) unions are syntactically wrong because defaultValues assigned to them doesn't match the union's defaultType.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With