GitHub user sachingsachin opened a pull request:
https://github.com/apache/avro/pull/20
AVRO-1568: Allow Java polymorphism in Avro for third-party code
The fix simply adds two APIs to ReflectData:
1) setSchema (Class<?> clazz, Schema s);
2) setSchema (Field field, Schema s);
With these two APIs, clients can create UNION schemas for any class/field
and set them accordingly.
With the UNION schema, avro can easily handle derived objects' presence on
base-class fields.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sachingsachin/avro AVRO-1568
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/avro/pull/20.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #20
----
commit bd63678fae95ec218b7f2b758c02c5c208c9fbbf
Author: Sachin Goyal <[email protected]>
Date: 2015-03-05T00:15:57Z
AVRO-1568: Allow Java polymorphism in Avro for third-party code
The fix simply adds two APIs to ReflectData:
1) setSchema (Class<?> clazz, Schema s);
2) setSchema (Field field, Schema s);
With these two APIs, clients can create UNION schemas for any class/field
and set them accordingly.
With the UNION schema, avro can easily handle derived objects' presence on
base-class fields.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---