@Override
  public Writable serialize(Object obj, ObjectInspector objInspector)
    throws SerDeException {
    if (objInspector.getCategory() != Category.STRUCT) {
      throw new SerDeException(getClass().toString()
        + " can only serialize struct types, but we got: "
        + objInspector.getTypeName());
    }
    return new DefaultHCatRecord((List<Object>) serializeStruct(obj, (StructObjectInspector) objInspector));
  }
The purpose of the serialize method is to turn an object-representation
with a provided ObjectInspector into a Writable format, which
the underlying layer can then use to write out.

In this case, it means that Hive will call this method to convert
an object with appropriate objectinspectors that it knows about,
to write out a HCatRecord.
hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/HCatRecordSerDe.java