code: public static Partition getPartition(HivePartition hivePartition) {
      State props = hivePartition.getProps();
      Partition partition = new Partition();
      partition.setDbName(hivePartition.getDbName());
      partition.setTableName(hivePartition.getTableName());
      partition.setValues(hivePartition.getValues());
      partition.setParameters(getParameters(props));
      if (hivePartition.getCreateTime().isPresent()) {
        partition.setCreateTime(Ints.checkedCast(hivePartition.getCreateTime().get()));
      } else if (props.contains(HiveConstants.CREATE_TIME)) {
        partition.setCreateTime(props.getPropAsInt(HiveConstants.CREATE_TIME));
      }
      if (props.contains(HiveConstants.LAST_ACCESS_TIME)) {
        partition.setLastAccessTime(props.getPropAsInt(HiveConstants.LAST_ACCESS_TIME));
      }
      partition.setSd(getStorageDescriptor(hivePartition));
      return partition;
    }
docs: Convert a {@link HivePartition} into a {@link Partition}.