{"record":{"id":"4f6a4a74c1fc674a","repo":"apache/iceberg","slug":"unknown-row-level-operation-mode","errorCode":null,"errorMessage":"Unknown row-level operation mode: ","messagePattern":"Unknown row-level operation mode: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/RowLevelOperationMode.java","lineNumber":57,"sourceCode":" */\npublic enum RowLevelOperationMode {\n  COPY_ON_WRITE(\"copy-on-write\"),\n  MERGE_ON_READ(\"merge-on-read\");\n\n  private final String modeName;\n\n  RowLevelOperationMode(String modeName) {\n    this.modeName = modeName;\n  }\n\n  public static RowLevelOperationMode fromName(String modeName) {\n    Preconditions.checkArgument(modeName != null, \"Mode name is null\");\n    if (COPY_ON_WRITE.modeName().equalsIgnoreCase(modeName)) {\n      return COPY_ON_WRITE;\n    } else if (MERGE_ON_READ.modeName().equalsIgnoreCase(modeName)) {\n      return MERGE_ON_READ;\n    } else {\n      throw new IllegalArgumentException(\"Unknown row-level operation mode: \" + modeName);\n    }\n  }\n\n  public String modeName() {\n    return modeName;\n  }\n}\n","sourceCodeStart":39,"sourceCodeEnd":65,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/RowLevelOperationMode.java#L39-L65","documentation":"RowLevelOperationMode.fromName throws IllegalArgumentException when the given mode name string matches neither 'copy-on-write' nor 'merge-on-read' (case-insensitive). It parses the write.merge.mode / delete mode table property value.","triggerScenarios":"Setting table property write.merge.mode (or spark.merge-on-read related mode configs) to an unrecognized string, then starting a COPY ON WRITE / MERGE ON WRITE operation that calls RowLevelOperationMode.fromName.","commonSituations":"Typos like 'copy_on_write', 'COW', 'mergeOnRead'; copying a mode value from another engine's config; version drift where a newer mode name is used on an older Iceberg.","solutions":["Set the mode property to exactly 'copy-on-write' or 'merge-on-read'.","Check the configured value with SQL: SHOW TBLPROPERTIES / DESCRIBE TABLE, and fix the typo.","Upgrade Iceberg if a newer mode value from documentation is not recognized."],"exampleFix":"// before\nALTER TABLE t SET TBLPROPERTIES ('write.merge.mode'='MOR');\n// after\nALTER TABLE t SET TBLPROPERTIES ('write.merge.mode'='merge-on-read');","handlingStrategy":"validation","validationCode":"String mode = table.properties().getOrDefault(TableProperties.MERGE_MODE, \"copy-on-write\");\nif (!\"copy-on-write\".equalsIgnoreCase(mode) && !\"merge-on-read\".equalsIgnoreCase(mode)) {\n  throw new IllegalArgumentException(\"invalid write.merge.mode: \" + mode);\n}","typeGuard":null,"tryCatchPattern":"try { RowLevelOperationMode.fromName(modeName); } catch (IllegalArgumentException e) { /* fall back to COPY_ON_WRITE */ }","preventionTips":["Use only documented mode values: copy-on-write, merge-on-read","Validate table properties at write time","Copy config values verbatim from docs, not other engines"],"tags":["iceberg","config","enum","row-level-operation"],"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"}