{"record":{"id":"492685d8c3b9e705","repo":"apache/iceberg","slug":"unsupported-format-in-using","errorCode":null,"errorMessage":"Unsupported format in USING: ","messagePattern":"Unsupported format in USING: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java","lineNumber":134,"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":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java#L116-L152","documentation":"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.","triggerScenarios":"Running CREATE TABLE ... USING <provider> where provider is e.g. 'delta', 'csv', 'json', or a typo like 'iceber'.","commonSituations":"Migrating Delta/other-format DDL to Iceberg without removing USING; typos in the provider; mixed-engine templates that default USING to another format.","solutions":["Remove the USING clause (default is Iceberg)","Set USING iceberg explicitly","Use one of parquet/avro/orc if intending a specific file format"],"exampleFix":"-- before\nCREATE TABLE t (id bigint) USING delta;\n-- after\nCREATE TABLE t (id bigint) USING iceberg;","handlingStrategy":"validation","validationCode":"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); }","typeGuard":"boolean isIcebergCompatibleProvider(String p) { return p == null || \"iceberg\".equalsIgnoreCase(p) || \"parquet\".equalsIgnoreCase(p) || \"avro\".equalsIgnoreCase(p) || \"orc\".equalsIgnoreCase(p); }","tryCatchPattern":"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; }","preventionTips":["Never copy USING <other-format> clauses from Delta/Parquet DDL templates","Default to omitting USING for Iceberg tables","Validate provider strings in SQL generators"],"tags":["spark","sql","ddl"],"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"}