private void updatePartitionsInBatch(Map<List<String>, Long> partValuesToId,
                                       List<Partition> newParts) throws MetaException {
    List<String> columns = Arrays.asList("\"CREATE_TIME\"", "\"LAST_ACCESS_TIME\"", "\"WRITE_ID\"");
    List<String> conditionKeys = Arrays.asList("\"PART_ID\"");
    String stmt = TxnUtils.createUpdatePreparedStmt("\"PARTITIONS\"", columns, conditionKeys);
    int maxRows = dbType.getMaxRows(maxBatchSize, 4);
    updateWithStatement(statement -> Batchable.runBatched(maxRows, newParts, new Batchable<Partition, Void>() {
      @Override
      public List<Void> run(List<Partition> input) throws SQLException {
        for (Partition p : input) {
          statement.setLong(1, p.getCreateTime());
          statement.setLong(2, p.getLastAccessTime());
          statement.setLong(3, p.getWriteId());
          statement.setLong(4, partValuesToId.get(p.getValues()));
          statement.addBatch();
        }
        statement.executeBatch();
        return null;
      }
    }), stmt);
  }
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