@Override
  public void write(Writable writable) throws IOException {
    if(!(writable instanceof AvroGenericRecordWritable)) {
      throw new IOException("Expecting instance of AvroGenericRecordWritable, " +
              "but received" + writable.getClass().getCanonicalName());
    }
    AvroGenericRecordWritable r = (AvroGenericRecordWritable)writable;
    dfw.append(r.getRecord());
  }
Write an Avro GenericRecord to an Avro data file.
ql/src/java/org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordWriter.java