public void alterPartitions(Map<List<String>, Long> partValuesToId, Map<Long, Long> partIdToSdId,
                              List<Partition> newParts) throws MetaException {
    List<Long> partIds = new ArrayList<>(newParts.size());
    Map<Long, Optional<Map<String, String>>> partParamsOpt = new HashMap<>();
    Map<Long, StorageDescriptor> idToSd = new HashMap<>();
    for (Partition newPart : newParts) {
      Long partId = partValuesToId.get(newPart.getValues());
      Long sdId = partIdToSdId.get(partId);
      partIds.add(partId);
      partParamsOpt.put(partId, Optional.ofNullable(newPart.getParameters()));
      idToSd.put(sdId, newPart.getSd());
    }

    // alter partitions does not change partition values,
    // so only PARTITIONS and PARTITION_PARAMS need to update.
    updatePartitionsInBatch(partValuesToId, newParts);
    updateParamTableInBatch("\"PARTITION_PARAMS\"", "\"PART_ID\"", partIds, partParamsOpt);
    updateStorageDescriptorInBatch(idToSd);
  }
Gets the next CS id from sequence MPartitionColumnStatistics and increment the CS id by numStats.
@return The CD id before update.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlUpdatePart.java