@Override
    public PartitionDesc read(Kryo kryo, Input input, Class<? extends PartitionDesc> type) {
      PartitionDesc partitionDesc = super.read(kryo, input, type);
      // The set methods in PartitionDesc intern the any duplicate strings which is why we call them
      // during de-serialization
      partitionDesc.setBaseFileName(partitionDesc.getBaseFileName());
      partitionDesc.setPartSpec(partitionDesc.getPartSpec());
      partitionDesc.setInputFileFormatClass(partitionDesc.getInputFileFormatClass());
      partitionDesc.setOutputFileFormatClass(partitionDesc.getOutputFileFormatClass());
      return partitionDesc;
    }
We use a custom {@link com.esotericsoftware.kryo.Serializer} for {@link PartitionDesc} objects
in order to invoke any string interning code present in the "setter" methods. {@link
PartitionDesc} objects are usually stored by {@link MapWork} objects and contain duplicate info
like input format class names, partition specs, etc.
ql/src/java/org/apache/hadoop/hive/ql/exec/SerializationUtilities.java