tazan007 wrote:
Yea makes sense. I am trying to go from Java to Avro :D so I ended up overriding getArraySize, getArrayElements, writeRecord, and writeString from ReflectDatumWriter so I could have it convert String to Utf8, Date to Long, and List to GenericArray.
Please consider contributing this. File an issue in Jira and attach the patch.
http://wiki.apache.org/hadoop/Avro/HowToContribute
Also had to make some changes to ReflectData's createSchema to support String and Lists and changed RecordSchema's fieldsToJson to translate Date objects to long. Basically a cluge but works for getting data out of my Java objects into Avro objects.
Perhaps we should make ReflectData extensible, so that subclasses can determine the implementation types?
Doug
