@Override
  public void write(DataOutput out) throws IOException {
    // Write schema since we need it to pull the data out. (see point #1 above)
    String schemaString = record.getSchema().toString(false);
    out.writeUTF(schemaString);

    schemaString = fileSchema.toString(false);
    out.writeUTF(schemaString);

    recordReaderID.write(out);

    // Write record to byte buffer
    GenericDatumWriter<GenericRecord> gdw = new GenericDatumWriter<GenericRecord>();
    BinaryEncoder be = EncoderFactory.get().directBinaryEncoder((DataOutputStream)out, null);

    gdw.setSchema(record.getSchema());
    gdw.write(record, be);
  }
Unique Id determine which record reader created this record
serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroGenericRecordWritable.java