apache/iceberg · error · IllegalArgumentException
Unsupported format in USING:
Error message
Unsupported format in USING:
What it means
Thrown when a Spark CREATE TABLE ... USING clause specifies a provider other than iceberg, parquet, avro, or orc. rebuildCreateProperties maps the USING provider to the default file format; anything unrecognized (and not literally 'iceberg') is rejected.
Source
Thrown at spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java:134
newOptions.put(key, value);
return new CaseInsensitiveStringMap(newOptions);
}
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
- Remove the USING clause (default is Iceberg)
- Set USING iceberg explicitly
- Use one of parquet/avro/orc if intending a specific file format
Example fix
-- before CREATE TABLE t (id bigint) USING delta; -- after CREATE TABLE t (id bigint) USING iceberg;
Defensive patterns
Strategy: validation
Validate before calling
String provider = providerFromSql(sql); if (provider != null && !List.of("iceberg","parquet","avro","orc").contains(provider.toLowerCase(Locale.ROOT))) { throw new IllegalArgumentException("Provider must be iceberg/parquet/avro/orc: " + provider); } Type guard
boolean isIcebergCompatibleProvider(String p) { return p == null || "iceberg".equalsIgnoreCase(p) || "parquet".equalsIgnoreCase(p) || "avro".equalsIgnoreCase(p) || "orc".equalsIgnoreCase(p); } Try / catch
try { spark.sql(ddl); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Unsupported format in USING")) { spark.sql(ddl.replaceAll("(?i)USING\\s+\\S+", "USING iceberg")); } else throw e; } Prevention
- Never copy USING <other-format> clauses from Delta/Parquet DDL templates
- Default to omitting USING for Iceberg tables
- Validate provider strings in SQL generators
When it happens
Trigger: Running CREATE TABLE ... USING <provider> where provider is e.g. 'delta', 'csv', 'json', or a typo like 'iceber'.
Common situations: Migrating Delta/other-format DDL to Iceberg without removing USING; typos in the provider; mixed-engine templates that default USING to another format.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Unsupported format in USING: ${provider}
- Cannot add column %s since setting default values in Spark i
- Cannot convert type to SQL: %s
- Cannot convert bound predicates to SQL
- Cannot convert predicate to SQL: %s
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/492685d8c3b9e705.
Report an issue: GitHub.