{"record":{"id":"1615132c831c3325","repo":"apache/iceberg","slug":"s-does-not-implement-removerows","errorCode":null,"errorMessage":"%s does not implement removeRows","messagePattern":"(.+?) does not implement removeRows","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/RowDelta.java","lineNumber":56,"sourceCode":"   */\n  RowDelta addRows(DataFile inserts);\n\n  /**\n   * Add a {@link DeleteFile} to the table.\n   *\n   * @param deletes a delete file of rows to delete\n   * @return this for method chaining\n   */\n  RowDelta addDeletes(DeleteFile deletes);\n\n  /**\n   * Remove a {@link DataFile} from the table.\n   *\n   * @param file a data file\n   * @return this for method chaining\n   */\n  default RowDelta removeRows(DataFile file) {\n    throw new UnsupportedOperationException(\n        getClass().getName() + \" does not implement removeRows\");\n  }\n\n  /**\n   * Removes a rewritten {@link DeleteFile} from the table.\n   *\n   * @param deletes a delete file that can be removed from the table\n   * @return this for method chaining\n   */\n  default RowDelta removeDeletes(DeleteFile deletes) {\n    throw new UnsupportedOperationException(\n        getClass().getName() + \" does not implement removeDeletes\");\n  }\n\n  /**\n   * Set the snapshot ID used in any reads for this operation.\n   *\n   * <p>Validations will check changes after this snapshot ID. If the from snapshot is not set, all","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/RowDelta.java#L38-L74","documentation":"RowDelta.removeRows(DataFile) is a default method on the RowDelta API for removing data files within a row-delta commit; the default throws UnsupportedOperationException when an implementation does not override it. It documents that removing rows/data files via RowDelta is optional for implementations, and the instance in use does not support it.","triggerScenarios":"Invoking removeRows(DataFile) on a RowDelta obtained from an implementation that only supports addRows/addDeletes/removeDeletes — typically a custom BaseRowDelta or an older core version predating this method.","commonSituations":"Mixed api/core versions where the core RowDelta implementation predates removeRows; custom table implementations or test doubles; third-party catalogs returning their own RowDelta.","solutions":["Upgrade iceberg-core to a version whose BaseRowDelta overrides removeRows(DataFile).","Use RewriteFiles.deleteFile(DataFile) instead if the goal is a file rewrite rather than a row-delta commit.","If you implement RowDelta, override removeRows(DataFile) to record the data file for removal."],"exampleFix":"// before\nRowDelta delta = table.newRowDelta();\ndelta.removeRows(dataFile); // impl throws\n// after\nRewriteFiles rewrite = table.newRewrite(); // removeRows equivalent for rewrites\nrewrite.deleteFile(dataFile);","handlingStrategy":"fallback","validationCode":"static boolean supportsRemoveRows(RowDelta delta) { return delta instanceof BaseRowDelta; }","typeGuard":"boolean canRemoveRows = rowDelta instanceof org.apache.iceberg.BaseRowDelta;","tryCatchPattern":"try {\n  delta.removeRows(dataFile);\n} catch (UnsupportedOperationException e) {\n  throw new IllegalStateException(\"Use RewriteFiles.deleteFile for rewrites; this RowDelta lacks removeRows\", e);\n}","preventionTips":["Match the operation type to the intent: RowDelta for per-commit deltas, RewriteFiles for file rewrites.","Keep api and core versions aligned.","Check the deprecated/newer method status before building on RowDelta extension points."],"tags":["java","iceberg","row-delta","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}