You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Christophe Le Saƫc <ch...@gmail.com> on 2023/12/15 08:55:34 UTC

[Discuss] Schema inheritance

Hello,

As suggested in this JIRA <https://issues.apache.org/jira/browse/AVRO-2918> and
this other one <https://issues.apache.org/jira/browse/AVRO-3176> , it could
be a nice feature in Avro to integrate record schema inheritance.
Concretely, a child schema have extra fields compare to its parent, and a
record which is declare to be of Parent type can be of Child type (nothing
fancy here, just classic inheritance).
Current alternative is to use union of record schema, but each schema have
to redefine all field of Parent schema.

I made 2 PR for this feature in Java module only (for the moment):
This one <https://github.com/apache/avro/pull/1776> to introduce hierarchy
in record schema; where child schema is define as {"type": "record:
Parent", "name": "Child" ... }
And this second one <https://github.com/apache/avro/pull/2322> to include
inheritance in generated code.


As it's a big feature, and i will soon not be able to work much for Avro
project (job change); i prefer let other decide to integrate this concept
or not; and if the way it's introduced sounds good or not.

Best regards,
Christophe.