code: public static HivePartition getHivePartition(Partition partition) {
      State partitionProps = getPartitionProps(partition);
      State storageProps = getStorageProps(partition.getSd());
      State serDeProps = getSerDeProps(partition.getSd().getSerdeInfo());
      HivePartition hivePartition =
          new HivePartition.Builder().withDbName(partition.getDbName()).withTableName(partition.getTableName())
              .withPartitionValues(partition.getValues()).withProps(partitionProps).withStorageProps(storageProps)
              .withSerdeProps(serDeProps).build();
      if (partition.getCreateTime() > 0) {
        hivePartition.setCreateTime(partition.getCreateTime());
      }
      if (partition.getSd().getCols() != null) {
        hivePartition.setColumns(getColumns(partition.getSd().getCols()));
      }
      if (partition.getSd().getBucketCols() != null) {
        hivePartition.setBucketColumns(partition.getSd().getBucketCols());
      }
      return hivePartition;
    }
docs: Convert a {@link Partition} into a {@link HivePartition}.