{"record":{"id":"fbabeb4ad8d8e37a","repo":"apache/cassandra","slug":"column-deletion-is-not-supported-by-table-s","errorCode":null,"errorMessage":"Column deletion is not supported by table %s","messagePattern":"Column 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":155,"sourceCode":"\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    }\n\n    private static String columnName(Cell<?> cell)\n    {\n        return cell.column().name.toCQLString();\n    }\n\n    /**\n     * A set of partition key or clustering column values.\n     */\n    public static final class ColumnValues implements Comparable<ColumnValues>","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AbstractMutableVirtualTable.java#L137-L173","documentation":"AbstractMutableVirtualTable is the base class for writable virtual tables. Mutations are dispatched to overridable apply* hooks; applyColumnDeletion is the hook invoked when an UPDATE/DELETE removes a column value. Unless a subclass overrides it, the base implementation rejects the operation with this InvalidRequestException, so the virtual table never supports cell-level deletes by default.","triggerScenarios":"A CQL DELETE of a specific column (or UPDATE setting a column to null) against a virtual table whose class does not override applyColumnDeletion, routed through apply() -> applyColumnDeletion(partitionKey, clusteringColumns, columnName).","commonSituations":"Users attempt cell-level deletes on system virtual tables (e.g. in system_views/system) that only implement full-row deletes or updates; tooling that blindly generates `DELETE col FROM virtual_table ...` statements.","solutions":["Remove the column deletion from the statement; delete the whole row instead (DELETE FROM table WHERE pk...) if the table supports row deletion.","Use an UPDATE that sets the column to an appropriate value rather than nulling it.","If you own the virtual table implementation, override applyColumnDeletion to persist the deletion semantics you need.","Check the table's documentation/description (DESCRIBE / system_views.tables) for which mutations are supported."],"exampleFix":"// before\nDELETE cache_hit_count FROM system_views.client_request_metrics_latency; // not supported\n// after\nUPDATE system_views.client_request_metrics_latency SET cache_hit_count = 0 WHERE ...; // or override applyColumnDeletion in the virtual table class","handlingStrategy":"validation","validationCode":"// Check the table's supported mutations before issuing a column delete\nVirtualTable vt = VirtualKeyspaceRegistry.instance.getTableMetadata(tableId) != null ? ... : null;\nboolean supports = vt instanceof AbstractMutableVirtualTable\n    && ((AbstractMutableVirtualTable) vt).overridesApplyColumnDeletion(); // or consult table docs","typeGuard":null,"tryCatchPattern":"try { session.execute(\"DELETE col FROM vtable WHERE pk = ?\", pk); }\ncatch (InvalidRequestException e) { if (e.getMessage().contains(\"Column deletion is not supported\")) { /* fall back to row delete or UPDATE */ } else throw e; }","preventionTips":["Never assume virtual tables accept cell-level deletes; check per-table mutation support.","Prefer whole-row deletes or UPDATEs on virtual tables.","Document mutation capabilities of any custom virtual table subclass."],"tags":["virtual-table","invalid-request","unsupported-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"}