{"record":{"id":"7acd41d39eab70fa","repo":"apache/cassandra","slug":"row-deletion-is-not-supported-by-table-s","errorCode":null,"errorMessage":"Row deletion is not supported by table %s","messagePattern":"Row deletion is not supported by table (.+?)","errorType":"exception","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/AbstractMutableLazyVirtualTable.java","lineNumber":70,"sourceCode":"\n    protected AbstractMutableLazyVirtualTable(TableMetadata metadata, OnTimeout onTimeout, Sorted sorted, Sorted sortedByPartitionKey)\n    {\n        super(metadata, onTimeout, sorted, sortedByPartitionKey);\n    }\n\n    protected void applyPartitionDeletion(Object[] partitionKeys)\n    {\n        throw invalidRequest(\"Partition deletion is not supported by table %s\", metadata());\n    }\n\n    protected void applyRangeTombstone(Object[] partitionKey, Object[] start, boolean startInclusive, Object[] end, boolean endInclusive)\n    {\n        throw invalidRequest(\"Range deletion is not supported by table %s\", metadata());\n    }\n\n    protected void applyRowDeletion(Object[] partitionKey, @Nullable Object[] clusteringKeys)\n    {\n        throw invalidRequest(\"Row deletion is not supported by table %s\", metadata());\n    }\n\n    protected void applyRowUpdate(Object[] partitionKeys, @Nullable Object[] clusteringKeys, ColumnMetadata[] columns, Object[] values)\n    {\n        throw invalidRequest(\"Column modification is not supported by table %s\", metadata());\n    }\n\n    private void applyRangeTombstone(Object[] pks, RangeTombstone rt)\n    {\n        Slice slice = rt.deletedSlice();\n        Object[] starts = composeClusterings(slice.start(), metadata());\n        Object[] ends = composeClusterings(slice.end(), metadata());\n        applyRangeTombstone(pks, starts, slice.start().isInclusive(), ends, slice.end().isInclusive());\n    }\n\n    private void applyRow(Object[] pks, Row row)\n    {\n        Object[] cks = row.clustering().kind() == STATIC_CLUSTERING ? null : composeClusterings(row.clustering(), metadata());","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AbstractMutableLazyVirtualTable.java#L52-L88","documentation":"The default applyRowDeletion implementation of AbstractMutableLazyVirtualTable throws this error: deleting individual rows is not supported unless the concrete virtual table overrides it. Virtual tables must explicitly enable row deletes.","triggerScenarios":"Executing 'DELETE FROM <virtual_table> WHERE <partition key> [AND <clustering key>]' against a virtual table that has not overridden applyRowDeletion(Object[], Object[]).","commonSituations":"Users assuming all mutable-looking virtual tables accept DELETE of rows; automation scripts deleting stale entries from virtual tables like batchlog-like or metrics views.","solutions":["Check the documentation of the specific virtual table to see which mutations it supports.","If the table does not support deletion, address the underlying runtime state that produces the rows.","If you implement the virtual table, override applyRowDeletion to implement the delete."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    session.execute(\"DELETE FROM system_views.some_table WHERE pk = ? AND ck = ?\", pk, ck);\n} catch (InvalidQueryException e) {\n    if (e.getMessage().contains(\"Row deletion is not supported\")) {\n        // table is not row-deletable; use the appropriate administrative interface\n    }\n}","preventionTips":["Check per-table mutation support before building DELETE logic against virtual tables.","Use nodetool or the relevant subsystem API to clear underlying state instead of DELETE.","Do not port generic table-cleanup scripts to virtual tables without review."],"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"}