apache/iceberg · error · java.lang.IllegalArgumentException

Unsupported format in USING: <provider>

Error message

Unsupported format in USING: <provider>

What it means

Spark3Util.rebuildCreateProperties converts a CREATE TABLE ... USING <provider> statement's provider into Iceberg default file format properties. Only parquet/avro/orc/iceberg (case-insensitive) or null are accepted; anything else throws IllegalArgumentException 'Unsupported format in USING: <provider>'.

Source

Thrown at spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java:127

  private static final String HIVE_NULL = "__HIVE_DEFAULT_PARTITION__";

  private Spark3Util() {}

  public static Map<String, String> rebuildCreateProperties(Map<String, String> createProperties) {
    ImmutableMap.Builder<String, String> tableProperties = ImmutableMap.builder();
    createProperties.entrySet().stream()
        .filter(entry -> !RESERVED_PROPERTIES.contains(entry.getKey()))
        .forEach(tableProperties::put);

    String provider = createProperties.get(TableCatalog.PROP_PROVIDER);
    if ("parquet".equalsIgnoreCase(provider)) {
      tableProperties.put(TableProperties.DEFAULT_FILE_FORMAT, "parquet");
    } else if ("avro".equalsIgnoreCase(provider)) {
      tableProperties.put(TableProperties.DEFAULT_FILE_FORMAT, "avro");
    } else if ("orc".equalsIgnoreCase(provider)) {
      tableProperties.put(TableProperties.DEFAULT_FILE_FORMAT, "orc");
    } else if (provider != null && !"iceberg".equalsIgnoreCase(provider)) {
      throw new IllegalArgumentException("Unsupported format in USING: " + provider);
    }

    return tableProperties.build();
  }

  /**
   * Applies a list of Spark table changes to an {@link UpdateProperties} operation.
   *
   * @param pendingUpdate an uncommitted UpdateProperties operation to configure
   * @param changes a list of Spark table changes
   * @return the UpdateProperties operation configured with the changes
   */
  public static UpdateProperties applyPropertyChanges(
      UpdateProperties pendingUpdate, List<TableChange> changes) {
    for (TableChange change : changes) {
      if (change instanceof TableChange.SetProperty) {
        TableChange.SetProperty set = (TableChange.SetProperty) change;
        pendingUpdate.set(set.property(), set.value());

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Use USING iceberg (or omit USING) and set the file format via TBLPROPERTIES ('write.format.default'='parquet'|'avro'|'orc')
  2. Change the provider to parquet/avro/orc if the intent was a format-qualified Iceberg table
  3. Remove USING clauses inherited from non-Iceberg DDL templates
  4. If converting an existing Spark datasource table, migrate data rather than declaring unsupported providers

Example fix

// before
CREATE TABLE t (...) USING csv
// after
CREATE TABLE t (...) USING iceberg TBLPROPERTIES ('write.format.default'='orc')
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("parquet", "avro", "orc", "iceberg");
if (provider != null && !allowed.contains(provider.toLowerCase(Locale.ROOT))) {
  throw new IllegalArgumentException("USING provider must be parquet/avro/orc/iceberg, got: " + provider);
}

Try / catch

try {
  spark.sql(ddl);
} catch (IllegalArgumentException e) {
  if (e.getMessage() != null && e.getMessage().startsWith("Unsupported format in USING")) {
    log.error("Fix the USING clause or set write.format.default instead: {}", e.getMessage());
  } else throw e;
}

Prevention

When it happens

Trigger: CREATE TABLE tbl (...) USING json/csv/text/parquet-etc WITH iceberg-style clauses, i.e. using a non-file-format provider together with Iceberg table creation handling.

Common situations: Copy-pasted DDL where USING csv or USING json was left in; attempts to create Iceberg tables over unsupported formats; typos like 'parguet'.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/9ba39c47052a3be7. Report an issue: GitHub.