@Override
  public void write(final long writeId, final byte[] record) throws StreamingException {
    checkAutoFlush();
    ingestSizeBytes += record.length;
    try {
      Object encodedRow = encode(record);
      int bucket = getBucket(encodedRow);
      List<String> partitionValues = getPartitionValues(encodedRow);
      getRecordUpdater(partitionValues, bucket).insert(writeId, encodedRow);

      // ingest size bytes gets resetted on flush() whereas connection stats is not
      conn.getConnectionStats().incrementRecordsWritten();
      conn.getConnectionStats().incrementRecordsSize(record.length);
    } catch (IOException e) {
      throw new StreamingIOFailure("Error writing record in transaction write id ("
        + writeId + ")", e);
    }
  }
Encode a record as an Object that Hive can read with the ObjectInspector associated with the
serde returned by {@link #createSerde}.  This is public so that test frameworks can use it.

@param record record to be deserialized
@return deserialized record as an Object
@throws SerializationError - any error during serialization or deserialization of record
streaming/src/java/org/apache/hive/streaming/AbstractRecordWriter.java