Subclassing Avro record? Subclassing Avro record? hadoop hadoop

Subclassing Avro record?


I think I understand what you're trying to do ("subclass" an Avro record in the Avro Schema definition file) but I don't think it's possible.

Instead, a way to do this would be to have EmployeeRecord have a PersonRecord member nested within it, and then the Employee-specific related info following. For example :

{   "type": "record",  "name": "PersonRecord",  "namespace": "com.yourapp",  "fields": [    {      "name": "first",      "type": "string"    },    { etc... }    ]}{   "type": "record",  "name": "EmployeeRecord",  "namespace": "com.yourapp",  "fields": [    {      "name": "PersonInfo",      "type": "PersonRecord"    },    {       "name": "salary",      "type": "int"     },    { etc... }    ]}