Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # user >> how to fill in an array (list) from java


+
Robey Pointer 2010-04-08, 04:20
+
Bruce Mitchener 2010-04-08, 04:24
+
Robey Pointer 2010-04-09, 22:23
+
Doug Cutting 2010-04-09, 22:30
+
Scott Carey 2010-04-10, 00:03
+
Robey Pointer 2010-04-10, 01:26
+
Doug Cutting 2010-04-12, 16:40
+
Kevin Oliver 2010-04-12, 20:17
Copy link to this message
-
Re: how to fill in an array (list) from java
+1 here, too.

On Mon, Apr 12, 2010 at 1:17 PM, Kevin Oliver <[EMAIL PROTECTED]> wrote:
> +1 for the helper factories.
>
> Also, I think better javadocs on the various Schema.createXXX methods as to what is expected would help reduce the learning curve. There was a lot of trial and error for me.
>
> -----Original Message-----
> From: Doug Cutting [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 12, 2010 9:41 AM
> To: [EMAIL PROTECTED]
> Subject: Re: how to fill in an array (list) from java
>
> Robey Pointer wrote:
>> Maybe we should add a type of Array that implements the avro array interface but doesn't require a schema?
>
> Instances must know their schema in order to implement #equals(),
> #compareTo() and #hashCode() consistently with their serialized form.
> This is because of unions.  Since different branches of a union are not
> directly comparable, unions are ordered by branch.
>
>> I'm pushing on this because if you look at my sample code, it's by far the ugliest part of assembling a reply.
>
> Perhaps we can instead work to simplify schema constructors?  For
> example, we might support something like:
>
>   Schema.arrayOf(Type.INTEGER)
>
> Similarly, we could add a unionOf that uses varargs, e.g.:
>
>   Schema.unionOf(Type.NULL, Type.STRING);
>
> Could such things help?
>
> Doug
>
>
>
+
Robey Pointer 2010-04-13, 06:17