[
https://issues.apache.org/jira/browse/AVRO-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16290624#comment-16290624
]
Miguel edited comment on AVRO-2115 at 12/14/17 9:47 AM:
--------------------------------------------------------
Good! Added Void to the test.
I have seen that
[documentation|https://avro.apache.org/docs/1.7.6/api/java/org/apache/avro/reflect/package-summary.html]
may be wrong. It says that:
Classes are mapped to Avro records. Only concrete classes with a no-argument
constructor are supported. All inherited fields that are not static or
transient are used. Fields are not permitted to be null unless annotated by
Nullable or *a Union containing null.*
Maybe should it be:
*... a Union containing Void.*
If you agree I add to the patch.
was (Author: elmendavies):
Good! Added Void to the test.
I have seen that
[documentation|https://avro.apache.org/docs/1.7.6/api/java/org/apache/avro/reflect/package-summary.html]
may be wrong. It says that:
"Classes are mapped to Avro records. Only concrete classes with a no-argument
constructor are supported. All inherited fields that are not static or
transient are used. Fields are not permitted to be null unless annotated by
Nullable or* a Union containing null.*"
Maybe should it be:
*"... a Union containing Void."*
If you agree I add to the patch.
> Support @Union in members too
> -----------------------------
>
> Key: AVRO-2115
> URL: https://issues.apache.org/jira/browse/AVRO-2115
> Project: Avro
> Issue Type: Improvement
> Reporter: Miguel
> Priority: Minor
>
> Allow defining unions in members:
> {code:java}
> class MyDatum {
> @Nullable
> @Union({String.class, Long.class, Other.class,...})
> Object o;
> }
> {code}
> It can currently be implemented using @AvroSchema like this, but it is seems
> in my oppinion more verbose and more difficult to maintain:
> {code:java}
> @AvroSchema("[\"null\",\"string\",...")
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)