@Override
      public void execute(String batchQueryText, int batchRowCount) throws MetaException {
        Object[] params = new Object[batchRowCount * columnCount];
        int index = 0;
        int paramIndex = 0;
        do {
          while (index < batchRowCount && it.hasNext()) {
            Map.Entry<String, String> entry = it.next();
            params[paramIndex++] = serdeEntry.getKey();
            params[paramIndex++] = entry.getKey();
            params[paramIndex++] = entry.getValue();
            index++;
          }
          if (index < batchRowCount) {
            serdeEntry = serdeIt.next(); // serdeIt.next() cannot be null since it is within the row count
            it = serdeEntry.getValue().getParameters() != null  ?
                serdeEntry.getValue().getParameters().entrySet().iterator() : Collections.emptyIterator();
          }
        } while (index < batchRowCount);
        executeQuery(batchQueryText, params);
      }
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