avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Taton <ta...@wibidata.com>
Subject Re: Could specific records implement the generic API as well?
Date Thu, 18 Apr 2013 20:18:54 GMT
Hi,

On Mon, Apr 15, 2013 at 3:43 PM, Doug Cutting <cutting@apache.org> wrote:

> I think GenericRecordBuilder could be used to build specific records
> with a few additional changes:
>  - change the type of the 'record' field from GenericData.Record to
> GenericRecord.
>  - replace the call to 'new GenericData.Record()' to
> '(GenericRecord)data().newRecord(null, schema())'
>  - add a constructor that accepts a GenericData instance, instead of
> calling GenericData.get().
>
> Then you could use new GenericRecordBuilder(SpecificData.get(),
> schema) to create specific records.
>

Symmetrically, do you think it's possible to have SpecificRecord builders
extend GenericRecordBuilder?

C.

Mime
View raw message