{"record":{"id":"e2d8aa093ead81cb","repo":"apache/cassandra","slug":"range-deletion-is-not-supported-by-table-s-e2d8aa","errorCode":null,"errorMessage":"Range deletion is not supported by table %s","messagePattern":"Range 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":145,"sourceCode":"            return Range.downTo(ColumnValues.from(metadata(), startBound), boundType(startBound));\n\n        ColumnValues start = ColumnValues.from(metadata(), startBound);\n        BoundType startType = boundType(startBound);\n\n        ColumnValues end = ColumnValues.from(metadata(), endBound);\n        BoundType endType = boundType(endBound);\n\n        return Range.range(start, startType, end, endType);\n    }\n\n    private static BoundType boundType(ClusteringBound<?> bound)\n    {\n        return bound.isInclusive() ? BoundType.CLOSED : BoundType.OPEN;\n    }\n\n    protected void applyRangeTombstone(ColumnValues partitionKey, Range<ColumnValues> range)\n    {\n        throw invalidRequest(\"Range deletion is not supported by table %s\", metadata);\n    }\n\n    protected void applyRowDeletion(ColumnValues partitionKey, ColumnValues clusteringColumns)\n    {\n        throw invalidRequest(\"Row deletion is not supported by table %s\", metadata);\n    }\n\n    protected void applyColumnDeletion(ColumnValues partitionKey, ColumnValues clusteringColumns, String columnName)\n    {\n        throw invalidRequest(\"Column deletion is not supported by table %s\", metadata);\n    }\n\n    protected void applyColumnUpdate(ColumnValues partitionKey,\n                                     ColumnValues clusteringColumns,\n                                     Optional<ColumnValue> columnValue)\n    {\n        throw invalidRequest(\"Column modification is not supported by table %s\", metadata);\n    }","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AbstractMutableVirtualTable.java#L127-L163","documentation":"AbstractMutableVirtualTable's default applyRangeTombstone throws this invalid-request error: deleting a clustering range within a partition is not supported unless the concrete virtual table overrides the method.","triggerScenarios":"Executing a DELETE with a clustering range condition, e.g. 'DELETE FROM <virtual_table> WHERE pk = ? AND ck > ? AND ck <= ?', which the coordinator translates into a range tombstone applied via applyRangeTombstone(ColumnValues, Range<ColumnValues>).","commonSituations":"Range-based cleanup of virtual-table rows; ORMs generating sliced DELETEs; interactive cqlsh sessions deleting ranges of metric-like rows.","solutions":["Delete fully-specified rows instead of ranges (applyRowDeletion may be supported).","Enumerate the clustering keys and delete rows individually or with IN.","If you implement the table, override applyRangeTombstone(ColumnValues, Range<ColumnValues>)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    session.execute(slicedDelete);\n} catch (InvalidQueryException e) {\n    if (e.getMessage().contains(\"Range deletion is not supported\")) {\n        // enumerate clustering keys and delete rows individually\n    }\n}","preventionTips":["Replace '>'/'<' range DELETE predicates with explicit key lists or per-row deletes.","Select the keys first and delete rows one by one when range deletes are unsupported.","Consult the virtual table source/docs to see whether applyRangeTombstone is overridden."],"tags":["virtual-tables","cql","delete","range-tombstone"],"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"}