public String getInsertQuery(List<Record> records, TableIdentifier identifier, boolean isOverwrite) {
    StringBuilder query = new StringBuilder(String.format("INSERT %s %s VALUES ",
        isOverwrite ? "OVERWRITE TABLE" : "INTO", identifier));

    records.forEach(record -> {
      query.append("(");
      query.append(record.struct().fields().stream()
              .map(field -> getStringValueForInsert(record.getField(field.name()), field.type()))
              .collect(Collectors.joining(",")));
      query.append("),");
    });
    query.setLength(query.length() - 1);
    return query.toString();
  }
Creates a partitioned Hive test table using Hive SQL. The table will be in the 'default' database.
The table will be populated with the provided List of {@link Record}s using a Hive insert statement.
@param shell The HiveShell used for Hive table creation
@param tableName The name of the test table
@param schema The schema used for the table creation
@param spec The partition specification for the table
@param fileFormat The file format used for writing the data
@param records The records with which the table is populated
@param formatVersion The version of the spec the table should use (format-version)
@param tblProperties Additional table properties
@param storageHandler Storage Handler to be used
@return The created table
@throws IOException If there is an error writing data
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestTables.java