{"record":{"id":"f11bdaebfb85c2ee","repo":"apache/iceberg","slug":"unsupported-format-in-using-provider","errorCode":null,"errorMessage":"Unsupported format in USING: ${provider}","messagePattern":"Unsupported format in USING: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java","lineNumber":130,"sourceCode":"    newOptions.put(key, value);\n    return new CaseInsensitiveStringMap(newOptions);\n  }\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":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java#L112-L148","documentation":"Spark3Util.rebuildCreateProperties converts a Spark CREATE TABLE's USING provider into Iceberg default file-format table properties. Only parquet, avro, and orc are recognized; any other non-null provider (other than 'iceberg' itself) is rejected with this IllegalArgumentException so unsupported storage formats fail fast at table creation.","triggerScenarios":"Running CREATE TABLE ... USING <provider> (via SparkCatalog/SparkSessionCatalog) where provider is not iceberg, parquet, avro, or orc — e.g. USING csv, USING json, USING text, or a custom DataSource.","commonSituations":"Copying DDL from non-Iceberg examples that used CSV/JSON sources; typo'd providers like 'parqet'; clustering tools that template USING clauses from Hive/Delta setups.","solutions":["Use USING iceberg (or omit USING when the SparkSessionCatalog is configured as the default catalog) and set the file format with TBLPROPERTIES ('format-version'/'write.format.default' or a SUPPORTED provider)","Change USING to one of parquet, avro, or orc","If a non-Iceberg source format is needed, create the Iceberg table first and write into it from the source via DataFrame/SQL insert"],"exampleFix":"// before\nCREATE TABLE t (...) USING csv;\n// after\nCREATE TABLE t (...) USING parquet; -- or USING iceberg","handlingStrategy":"validation","validationCode":"if (provider != null && !Set.of(\"iceberg\",\"parquet\",\"avro\",\"orc\").contains(provider.toLowerCase(Locale.ROOT))) { throw new IllegalArgumentException(\"Unsupported format in USING: \" + provider); }","typeGuard":"boolean isSupportedProvider(String p) { return p == null || Set.of(\"iceberg\",\"parquet\",\"avro\",\"orc\").contains(p.toLowerCase(Locale.ROOT)); }","tryCatchPattern":"try { Spark3Util.rebuildCreateProperties(desc); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unsupported format in USING\")) { /* correct the USING clause */ } else throw e; }","preventionTips":["Always use USING iceberg or omit USING with a session catalog default","Only parquet/avro/orc are valid explicit providers with Iceberg DDL","Don't copy USING clauses from CSV/JSON/Delta examples","Add DDL linting in CI for CREATE TABLE statements"],"tags":["spark","ddl","unsupported-format"],"backgroundTag":"invalid-enum-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"}