You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by S G <sg...@gmail.com> on 2014/08/10 05:53:15 UTC
Why are java.* classes excluded from Avro serialization?
Hi,
I see that all the java classes in java.util package are completely ignored
by Avro.
This includes some of the very commonly used classes like:
1) java.util.Date,
2) java.util.UUID,
3) java.util.Currency and
4) java.util.Locale etc.
The code that does that is in ReflectData#getFields(Class<?> recordClass,
boolean excludeJava)
It is called from ReflectData#getCachedFields(Class<?> recordClass) as
getFields(recordClass, true)
Thinking aloud, would it be a good idea to have a white-list of classes
(like those mentioned above) such that the internals of those classes would
be always serialized, thus adding support for these commonly-used types in
Avro?
Another solution could be to have a custom-encoding for all such classes.
Please suggest.
Thanks
Sachin