{"record":{"id":"6177fda3618ea5f7","repo":"prestodb/presto","slug":"deleterows-called-on-emptysplitpagesource","errorCode":null,"errorMessage":"deleteRows called on EmptySplitPageSource","messagePattern":"deleteRows 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":34,"sourceCode":"import com.facebook.presto.common.Page;\nimport com.facebook.presto.common.block.Block;\nimport com.facebook.presto.spi.UpdatablePageSource;\nimport com.google.common.collect.ImmutableList;\nimport io.airlift.slice.Slice;\n\nimport 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;","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/split/EmptySplitPageSource.java#L16-L52","documentation":"EmptySplitPageSource is a placeholder UpdatablePageSource used when a connector supplies an empty split; it does not support row deletion. Calling deleteRows on it throws UnsupportedOperationException because there are no underlying pages/rows to delete.","triggerScenarios":"An UPDATE/DELETE (MERGE delete) plan assigns an EmptySplitPageSource as the page source and the connector's page sink provider still routes deleteRows(Block rowIds) calls to it instead of a real updatable source.","commonSituations":"A connector that returns empty splits but does not fully implement updatable (upsert/delete) page sources; queries hitting connector tables whose split provider yields no data but the delete path still executes.","solutions":["Verify the connector actually supports deletable tables and returns a real updatable page source instead of empty splits","Avoid issuing DELETE/UPDATE against tables served by this connector","If you are a connector author, implement deleteRows/updateRows or throw a clearer PrestoException (NOT_SUPPORTED) in the connector","Check plan/split assignment for a bug where empty splits are wrongly chosen for DML"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before issuing DELETE on a connector table, verify connector support:\nif (!connectorMetadata.supportsRemove()) throw new IllegalStateException(\"connector does not support delete\");","typeGuard":"function isUpdatable(src) { return src !== null && typeof src.deleteRows === 'function' && !(src instanceof EmptySplitPageSource); }","tryCatchPattern":"try { pageSource.deleteRows(rowIds); } catch (UnsupportedOperationException e) { throw new PrestoException(NOT_SUPPORTED, \"table does not support delete\", e); }","preventionTips":["Only issue DML against tables from connectors advertising update support","Connector authors: implement full UpdatablePageSource or fail with NOT_SUPPORTED early","Test UPDATE/DELETE paths against your connector's empty-split scenarios"],"tags":["connector","unsupported-operation","delete"],"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"}