{"record":{"id":"9ba39c47052a3be7","repo":"apache/iceberg","slug":"unsupported-format-in-using-provider-9ba39c","errorCode":null,"errorMessage":"Unsupported format in USING: <provider>","messagePattern":"Unsupported format in USING: <provider>","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java","lineNumber":127,"sourceCode":"  private static final String HIVE_NULL = \"__HIVE_DEFAULT_PARTITION__\";\n\n  private Spark3Util() {}\n\n  public static Map<String, String> rebuildCreateProperties(Map<String, String> createProperties) {\n    ImmutableMap.Builder<String, String> tableProperties = ImmutableMap.builder();\n    createProperties.entrySet().stream()\n        .filter(entry -> !RESERVED_PROPERTIES.contains(entry.getKey()))\n        .forEach(tableProperties::put);\n\n    String provider = createProperties.get(TableCatalog.PROP_PROVIDER);\n    if (\"parquet\".equalsIgnoreCase(provider)) {\n      tableProperties.put(TableProperties.DEFAULT_FILE_FORMAT, \"parquet\");\n    } else if (\"avro\".equalsIgnoreCase(provider)) {\n      tableProperties.put(TableProperties.DEFAULT_FILE_FORMAT, \"avro\");\n    } else if (\"orc\".equalsIgnoreCase(provider)) {\n      tableProperties.put(TableProperties.DEFAULT_FILE_FORMAT, \"orc\");\n    } else if (provider != null && !\"iceberg\".equalsIgnoreCase(provider)) {\n      throw new IllegalArgumentException(\"Unsupported format in USING: \" + provider);\n    }\n\n    return tableProperties.build();\n  }\n\n  /**\n   * Applies a list of Spark table changes to an {@link UpdateProperties} operation.\n   *\n   * @param pendingUpdate an uncommitted UpdateProperties operation to configure\n   * @param changes a list of Spark table changes\n   * @return the UpdateProperties operation configured with the changes\n   */\n  public static UpdateProperties applyPropertyChanges(\n      UpdateProperties pendingUpdate, List<TableChange> changes) {\n    for (TableChange change : changes) {\n      if (change instanceof TableChange.SetProperty) {\n        TableChange.SetProperty set = (TableChange.SetProperty) change;\n        pendingUpdate.set(set.property(), set.value());","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java#L109-L145","documentation":"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>'.","triggerScenarios":"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.","commonSituations":"Copy-pasted DDL where USING csv or USING json was left in; attempts to create Iceberg tables over unsupported formats; typos like 'parguet'.","solutions":["Use USING iceberg (or omit USING) and set the file format via TBLPROPERTIES ('write.format.default'='parquet'|'avro'|'orc')","Change the provider to parquet/avro/orc if the intent was a format-qualified Iceberg table","Remove USING clauses inherited from non-Iceberg DDL templates","If converting an existing Spark datasource table, migrate data rather than declaring unsupported providers"],"exampleFix":"// before\nCREATE TABLE t (...) USING csv\n// after\nCREATE TABLE t (...) USING iceberg TBLPROPERTIES ('write.format.default'='orc')","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"parquet\", \"avro\", \"orc\", \"iceberg\");\nif (provider != null && !allowed.contains(provider.toLowerCase(Locale.ROOT))) {\n  throw new IllegalArgumentException(\"USING provider must be parquet/avro/orc/iceberg, got: \" + provider);\n}","typeGuard":null,"tryCatchPattern":"try {\n  spark.sql(ddl);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unsupported format in USING\")) {\n    log.error(\"Fix the USING clause or set write.format.default instead: {}\", e.getMessage());\n  } else throw e;\n}","preventionTips":["Use USING iceberg (or none) and control file format via write.format.default property","Template DDL without leftover USING csv/json clauses","Case-insensitive check of provider before running CREATE TABLE DDL"],"tags":["spark","ddl","unsupported-format"],"backgroundTag":"invalid-argument-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}