private void insertSkewColValueLocInBatch(Map<Long, List<Pair<Long, String>>> sdIdToColValueLoc,
                                            List<Long> sdIds) throws MetaException {
    List<String> columns = Arrays.asList("\"SD_ID\"", "\"STRING_LIST_ID_KID\"", "\"LOCATION\"");
    String insertQuery = TxnUtils.createInsertPreparedStmt("\"SKEWED_COL_VALUE_LOC_MAP\"", columns);
    List<Long> idWithColValueLoc = filterIdsByNonNullValue(sdIds, sdIdToColValueLoc);
    int maxRows = dbType.getMaxRows(maxBatchSize, 3);
    updateWithStatement(statement -> Batchable.runBatched(maxRows, idWithColValueLoc,
        new Batchable<Long, Void>() {
          @Override
          public List<Void> run(List<Long> input) throws Exception {
            for (Long sdId : input) {
              List<Pair<Long, String>> stringListIdAndLoc = sdIdToColValueLoc.get(sdId);
              for (Pair<Long, String> pair : stringListIdAndLoc) {
                statement.setLong(1, sdId);
                statement.setLong(2, pair.getLeft());
                statement.setString(3, pair.getRight());
                statement.addBatch();
              }
            }
            statement.executeBatch();
            return null;
          }
        }
    ), insertQuery);
  }
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