avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Schema for array of records
Date Mon, 21 Mar 2011 18:20:02 GMT
On 03/21/2011 10:47 AM, Curtis Jensen wrote:
> In one of my iterations of trying to get this to work, I tried the
> straight array schema you suggested.  However, in Java, how do I
> create a "User" record?  After parsing the schema, the only schema
> object I can create from it is an Array object.  How do I populate the
> array?

If you're using the generic data representation, then you can create a
new instance of a User with something like:

new GenericData.Record(arraySchema.getElementType());

Doug

Mime
View raw message