private void insertSkewedStringListInBatch(List<Long> stringListIds) throws MetaException {
    int rowCount = stringListIds.size();
    String columns = "(\"STRING_LIST_ID\")";
    int columnCount = 1;
    BatchExecutionContext batchExecutionContext = new BatchExecutionContext() {
      final Iterator<Long> it = stringListIds.iterator();
      @Override
      public void execute(String batchQueryText, int batchRowCount) throws MetaException {
        Object[] params = new Object[batchRowCount * columnCount];
        int paramIndex = 0;
        for (int index = 0; index < batchRowCount; index++) {
          params[paramIndex++] = it.next();
        }
        executeQuery(batchQueryText, params);
      }
    };
    insertInBatch("\"SKEWED_STRING_LIST\"", columns, columnCount, rowCount, batchExecutionContext);
  }
Interface to execute multiple row insert query in batch for direct SQL
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlInsertPart.java