private void insertSkewedValuesInBatch(Map<Long, List<Long>> sdIdToStringListId,
                                        List<Long> sdIds) throws MetaException {
    List<String> columns = Arrays.asList("\"SD_ID_OID\"", "\"INTEGER_IDX\"", "\"STRING_LIST_ID_EID\"");
    String insertQuery = TxnUtils.createInsertPreparedStmt("\"SKEWED_VALUES\"", columns);
    List<Long> idWithSkewedValues = filterIdsByNonNullValue(sdIds, sdIdToStringListId);
    int maxRows = dbType.getMaxRows(maxBatchSize, 3);
    updateWithStatement(statement -> Batchable.runBatched(maxRows, idWithSkewedValues,
        new Batchable<Long, Void>() {
          @Override
          public List<Void> run(List<Long> input) throws Exception {
            for (Long sdId : input) {
              List<Long> stringListIds = sdIdToStringListId.get(sdId);
              for (int i = 0; i < stringListIds.size(); i++) {
                statement.setLong(1, sdId);
                statement.setInt(2, i);
                statement.setLong(3, stringListIds.get(i));
                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