-GenericDatumReader and datum reuse
kulkarni.swarnim@...) 2013-10-30, 19:07
While going thorough the API for GenericDatumReader, I came across this
read method and it wasn't immediately clear to me as to what the "reuse"
of the datum really means.
So for instance if I have an evolving schema, should this datum be created
from the readerSchema or the writerSchema. So something like:
record = new GenericData.Record(readerSchema); // created with readerSchema
GenericDatumReader<GenericRecord> gdr newGenericDatumReader<GenericRecord>(writerSchema, readerSchema);
record = gdr.read(record, binaryDecoder);
Or is it better to simply leave it off as null?
record = gdr.read(null, binaryDecoder);
Doug Cutting 2013-10-31, 15:24