{"record":{"id":"899052ed6d33e2e1","repo":"prestodb/presto","slug":"updaterows-called-on-emptysplitpagesource","errorCode":null,"errorMessage":"updateRows called on EmptySplitPageSource","messagePattern":"updateRows called on EmptySplitPageSource","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/split/EmptySplitPageSource.java","lineNumber":40,"sourceCode":"import java.util.Collection;\nimport java.util.List;\nimport java.util.concurrent.CompletableFuture;\n\nimport static java.util.concurrent.CompletableFuture.completedFuture;\n\npublic class EmptySplitPageSource\n        implements UpdatablePageSource\n{\n    @Override\n    public void deleteRows(Block rowIds)\n    {\n        throw new UnsupportedOperationException(\"deleteRows called on EmptySplitPageSource\");\n    }\n\n    @Override\n    public void updateRows(Page page, List<Integer> columnValueAndRowIdChannels)\n    {\n        throw new UnsupportedOperationException(\"updateRows called on EmptySplitPageSource\");\n    }\n\n    @Override\n    public CompletableFuture<Collection<Slice>> finish()\n    {\n        return completedFuture(ImmutableList.of());\n    }\n\n    @Override\n    public long getCompletedBytes()\n    {\n        return 0;\n    }\n\n    @Override\n    public long getCompletedPositions()\n    {\n        return 0;","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/split/EmptySplitPageSource.java#L22-L58","documentation":"EmptySplitPageSource.updateRows throws UnsupportedOperationException: this placeholder page source cannot apply row updates. Updates require a real connector-implemented UpdatablePageSource with actual data channels.","triggerScenarios":"An UPDATE plan whose page source is an EmptySplitPageSource reaches updateRows(Page, List<Integer> columnValueAndRowIdChannels), i.e. the connector's split provider returned an empty split where a real updatable source was required.","commonSituations":"Connector tables that do not support UPDATE being targeted by UPDATE statements; connector authors returning EmptySplitPageSource from getPageSource in connectors that advertise updatability.","solutions":["Ensure the connector supports updates and returns a real updatable page source for the given split","Refrain from running UPDATE statements on tables from connectors lacking update support","Connector authors: return a proper UpdatablePageSource or fail earlier with NOT_SUPPORTED PrestoException","Inspect split assignment to confirm empty splits are not incorrectly used in DML plans"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before issuing UPDATE on a connector table, verify connector support:\nif (!connectorMetadata.supportsUpdate()) throw new IllegalStateException(\"connector does not support update\");","typeGuard":"function isUpdatable(src) { return src !== null && typeof src.updateRows === 'function' && !(src instanceof EmptySplitPageSource); }","tryCatchPattern":"try { pageSource.updateRows(page, channels); } catch (UnsupportedOperationException e) { throw new PrestoException(NOT_SUPPORTED, \"table does not support update\", e); }","preventionTips":["Verify connector update support before planning UPDATE statements","Connector authors: return real updatable sources for splits of updatable tables","Add integration tests covering UPDATE with empty splits"],"tags":["connector","unsupported-operation","update"],"backgroundTag":"unsupported-operation-on-placeholder-source","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}