{"record":{"id":"0d9dd2f7f41ab28e","repo":"apache/iceberg","slug":"unsupported-command-command","errorCode":null,"errorMessage":"Unsupported command: ${command}","messagePattern":"Unsupported command: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkRowLevelOperationBuilder.java","lineNumber":89,"sourceCode":"        throw new IllegalArgumentException(\"Unsupported operation mode: \" + mode);\n    }\n  }\n\n  private RowLevelOperationMode mode(Map<String, String> properties, Command command) {\n    String modeName;\n\n    switch (command) {\n      case DELETE:\n        modeName = properties.getOrDefault(DELETE_MODE, DELETE_MODE_DEFAULT);\n        break;\n      case UPDATE:\n        modeName = properties.getOrDefault(UPDATE_MODE, UPDATE_MODE_DEFAULT);\n        break;\n      case MERGE:\n        modeName = properties.getOrDefault(MERGE_MODE, MERGE_MODE_DEFAULT);\n        break;\n      default:\n        throw new IllegalArgumentException(\"Unsupported command: \" + command);\n    }\n\n    return RowLevelOperationMode.fromName(modeName);\n  }\n\n  private IsolationLevel isolationLevel(Map<String, String> properties, Command command) {\n    String levelName;\n\n    switch (command) {\n      case DELETE:\n        levelName = properties.getOrDefault(DELETE_ISOLATION_LEVEL, DELETE_ISOLATION_LEVEL_DEFAULT);\n        break;\n      case UPDATE:\n        levelName = properties.getOrDefault(UPDATE_ISOLATION_LEVEL, UPDATE_ISOLATION_LEVEL_DEFAULT);\n        break;\n      case MERGE:\n        levelName = properties.getOrDefault(MERGE_ISOLATION_LEVEL, MERGE_ISOLATION_LEVEL_DEFAULT);\n        break;","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkRowLevelOperationBuilder.java#L71-L107","documentation":"SparkRowLevelOperationBuilder.mode() resolves which table property to read the row-level mode from. Only DELETE, UPDATE, and MERGE Spark Commands are recognized; any other command reaches the default branch and throws IllegalArgumentException.","triggerScenarios":"build() is invoked for a RowLevelOperation whose Command is not DELETE, UPDATE, or MERGE — e.g. a custom or newly added Spark command wired to the Iceberg row-level operation builder without extending the switch.","commonSituations":"Running a newly introduced Spark command (or a third-party command) against an Iceberg version whose builder predates support for it; plugging Iceberg's builder into a custom DML command.","solutions":["Use a supported command: DELETE FROM, UPDATE, or MERGE INTO against the Iceberg table.","Upgrade Iceberg to a version that supports the command in SparkRowLevelOperationBuilder.","If extending Iceberg, add a case for the new command to the switch in mode()."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!(command instanceof DeleteFromTable || command instanceof UpdateTable || command instanceof MergeIntoTable)) {\n  throw new IllegalArgumentException(\"Iceberg row-level ops support only DELETE/UPDATE/MERGE, got \" + command.getClass());\n}","typeGuard":null,"tryCatchPattern":"try {\n  builder.mode(properties, command);\n} catch (IllegalArgumentException e) {\n  // fall back to plain append/overwrite path\n}","preventionTips":["Only route DELETE FROM, UPDATE, MERGE INTO through Iceberg's row-level operation builder.","Upgrade Iceberg when adopting new Spark DML commands.","Extend the switch when adding commands in a fork."],"tags":["spark","row-level-writes","invalid-enum-value"],"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"}