You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by "Andrei I. Holub" <an...@gmail.com> on 2016/10/28 20:58:24 UTC

Closest common ancestor for unions

If field is declared as union, it will be transformed to the Object (java)
during the schema generation.
Is it possible to change this behaviour and pick common closest ancestor
interface in the generated classes?
The other option could be providing the interface/class as a metadata and
check if union's members can be casted to it during generation. In any case
we always have Object as a backup solution if something goes wrong.
With this solution will be possible to implement some inheritance
immitation which can be nice addition to the cases where avro can be used.