@Override
    public boolean equals(Object o) {
      if (this == o)
        return true;
      if (o == null || getClass() != o.getClass())
        return false;
      StorageDescriptorKey that = (StorageDescriptorKey) o;

      if (!Objects.equals(baseLocation, that.baseLocation)) {
        return false;
      }

      if (sd == null && that.sd == null) {
        return true;
      }

      if (sd == null || that.sd == null) {
        return false;
      }

      if (!Objects.equals(sd.getOutputFormat(), that.sd.getOutputFormat())) {
        return false;
      }
      if (!Objects.equals(sd.getCols(), that.sd.getCols())) {
        return false;
      }
      if (!Objects.equals(sd.getInputFormat(), that.sd.getInputFormat())) {
        return false;
      }

      if (!Objects.equals(sd.getSerdeInfo(), that.sd.getSerdeInfo())) {
        return false;
      }
      if (sd.getSerdeInfo() != null && that.sd.getSerdeInfo() == null) {
        return false;
      }
      if (sd.getSerdeInfo() == null && that.sd.getSerdeInfo() != null) {
        return false;
      }
      if (sd.getSerdeInfo() != null && that.sd.getSerdeInfo() != null &&
          !Objects.equals(sd.getSerdeInfo().getSerializationLib(),
              that.sd.getSerdeInfo().getSerializationLib())) {
        return false;
      }
      return true;
    }
This class is used to group the partitions based on a shared storage descriptor.
The following fields are considered for hashing/equality:
<ul>
  <li>location</li>
  <li>serializationLib</li>
  <li>inputFormat</li>
  <li>outputFormat</li>
  <li>columns</li>
</ul>

For objects that share these can share the same storage descriptor,
significantly reducing on-the-wire cost.

Check {@link #getPartitionspecsGroupedByStorageDescriptor} for more details
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreServerUtils.java