Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Feature Request: Support for Map and Array #1

Open
ccsevers opened this issue Apr 27, 2012 · 0 comments
Open

Feature Request: Support for Map and Array #1

ccsevers opened this issue Apr 27, 2012 · 0 comments

Comments

@ccsevers
Copy link

It would be really nice to be able to read in avro maps and arrays (possibly with other nested maps and arrays) and also write them out.

I'm happy to help with this but my initial tries at modifying the project with this support (using cascading.kryo for the serialization) has given me cast errors from List to Comparable. Taking away the Avro part and just using cascading.kryo and TextLine works fine however.

For array I would try adding something like the following to the toAvro() method:

case ARRAY:
GenericData.Array avroArray = new GenericData.Array(((List)val).size(), typeInfo.schema);
avroArray.addAll((List)val);
return avroArray;

and do similar for map. It may be the case that an examination of each element of the list or value set of the map is needed in order to also call toAvro() on them but that's pretty easy to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant