{"record":{"id":"eac7d9838f5ce7eb","repo":"apache/cassandra","slug":"partition-deletion-is-not-supported-by-table-s-eac7d9","errorCode":null,"errorMessage":"Partition deletion is not supported by table %s","messagePattern":"Partition deletion is not supported by table (.+?)","errorType":"exception","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/AbstractMutableVirtualTable.java","lineNumber":110,"sourceCode":"                else\n                    applyRowDeletion(partitionKey, clusteringColumns);\n            });\n        else\n        {\n            // MutableDeletionInfo may have partition delete or range tombstone list or both\n            if (update.deletionInfo().hasRanges())\n                update.deletionInfo()\n                        .rangeIterator(false)\n                        .forEachRemaining(rt -> applyRangeTombstone(partitionKey, toRange(rt.deletedSlice())));\n\n            if (!update.deletionInfo().getPartitionDeletion().isLive())\n                applyPartitionDeletion(partitionKey);\n        }\n    }\n\n    protected void applyPartitionDeletion(ColumnValues partitionKey)\n    {\n        throw invalidRequest(\"Partition deletion is not supported by table %s\", metadata);\n    }\n\n    private Range<ColumnValues> toRange(Slice slice)\n    {\n        ClusteringBound<?> startBound = slice.start();\n        ClusteringBound<?> endBound = slice.end();\n\n        if (startBound.isBottom())\n        {\n            if (endBound.isTop())\n                return Range.all();\n\n            return Range.upTo(ColumnValues.from(metadata(), endBound), boundType(endBound));\n        }\n\n        if (endBound.isTop())\n            return Range.downTo(ColumnValues.from(metadata(), startBound), boundType(startBound));\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AbstractMutableVirtualTable.java#L92-L128","documentation":"AbstractMutableVirtualTable's default applyPartitionDeletion throws this invalid-request error: partition-level DELETEs are not supported unless the concrete virtual table overrides the method with ColumnValues-based semantics. The table metadata is included in the message.","triggerScenarios":"Running 'DELETE FROM <virtual_table> WHERE <complete partition key>' against a virtual table extending AbstractMutableVirtualTable without an applyPartitionDeletion override.","commonSituations":"Users cleaning up virtual-table partitions; drivers issuing implicit partition deletes (e.g. DELETE with only the partition key specified); scripts ported from normal-table maintenance to virtual tables.","solutions":["Delete individual rows instead (if row deletion is supported).","Avoid DELETE on this virtual table and manage the underlying state directly.","If you implement the table, override applyPartitionDeletion(ColumnValues) to support partition deletes."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    session.execute(\"DELETE FROM some_virtual_table WHERE pk = ?\", pk);\n} catch (InvalidQueryException e) {\n    if (e.getMessage().contains(\"Partition deletion is not supported\")) {\n        // fall back to row-level deletes or address the underlying state\n    }\n}","preventionTips":["Issue row-level deletes with full clustering keys if the table supports them.","Verify mutation support per virtual table before automating DELETEs.","Remember virtual tables expose live state; purge the state at its source instead."],"tags":["virtual-tables","cql","delete"],"backgroundTag":"unsupported-operation","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}