private void updateSerdeInBatch(List<Long> ids, Map<Long, SerDeInfo> idToSerde)
      throws MetaException {
    // Followed the jdo implement to update only NAME and SLIB of SERDES.
    List<String> columns = Arrays.asList("\"NAME\"", "\"SLIB\"");
    List<String> condKeys = Arrays.asList("\"SERDE_ID\"");
    String updateStmt = TxnUtils.createUpdatePreparedStmt("\"SERDES\"", columns, condKeys);
    List<Long> idWithSerde = filterIdsByNonNullValue(ids, idToSerde);
    int maxRows = dbType.getMaxRows(maxBatchSize, 3);
    updateWithStatement(statement -> Batchable.runBatched(maxRows, idWithSerde,
        new Batchable<Long, Void>() {
          @Override
          public List<Void> run(List<Long> input) throws SQLException {
            for (Long id : input) {
              SerDeInfo serde = idToSerde.get(id);
              statement.setString(1, serde.getName());
              statement.setString(2, serde.getSerializationLib());
              statement.setLong(3, id);
              statement.addBatch();
            }
            statement.executeBatch();
            return null;
          }
    }), updateStmt);
  }
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