private void insertSkewedColNamesInBatch(Map<Long, List<String>> sdIdToSkewedColNames,
                                           List<Long> sdIds) throws MetaException {
    List<String> columns = Arrays.asList("\"SD_ID\"", "\"INTEGER_IDX\"", "\"SKEWED_COL_NAME\"");
    String stmt = TxnUtils.createInsertPreparedStmt("\"SKEWED_COL_NAMES\"", columns);
    List<Long> idWithSkewedCols = filterIdsByNonNullValue(sdIds, sdIdToSkewedColNames);
    int maxRows = dbType.getMaxRows(maxBatchSize, 3);
    updateWithStatement(statement -> Batchable.runBatched(maxRows, idWithSkewedCols, new Batchable<Long, Object>() {
      @Override
      public List<Object> run(List<Long> input) throws SQLException {
        for (Long id : input) {
          List<String> skewedColNames = sdIdToSkewedColNames.get(id);
          for (int i = 0; i < skewedColNames.size(); i++) {
            statement.setLong(1, id);
            statement.setInt(2, i);
            statement.setString(3, skewedColNames.get(i));
            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