avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AVRO-432) add java annotation to specify arbitrary schema
Date Fri, 26 Feb 2010 23:40:05 GMT

     [ https://issues.apache.org/jira/browse/AVRO-432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Doug Cutting updated AVRO-432:

    Attachment: AVRO-432.patch

Here's a new version of the patch.  Instead of specifying an arbitrary schema, I've added
an annotation (@Nullable) that permits one to specify that a value may be null.  This simplifies
the most common use cases of @Union, and satisfies the case in question here.

> add java annotation to specify arbitrary schema
> -----------------------------------------------
>                 Key: AVRO-432
>                 URL: https://issues.apache.org/jira/browse/AVRO-432
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.3.0
>            Reporter: Doug Cutting
>             Fix For: 1.3.1
>         Attachments: AVRO-432.patch, AVRO-432.patch
> HDFS now includes a class (HdfsFileStatus) with a field (symlink) whose type is byte[]
but which is null for non-symlinks.  For most other types, we could annotate this with something
like @Union({Void.class, Foo.class}) to declare that the field may be null.  But there is
unfortunately no way to refer to the class of byte[] in an annotation.  So, instead, I propose
to add an annotation that permits the specification of an arbitrary schema.  In this case,
the annotation would then be @AvroSchema("[\"null\",\bytes\"").

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message