apache/cassandra · error · InvalidRequestException
Partition deletion is not supported by table
Error message
Partition deletion is not supported by table %s
What it means
AbstractMutableLazyVirtualTable lets concrete virtual tables opt into which mutations they support. The default applyPartitionDeletion implementation throws this invalid-request error because the table did not override it, meaning DELETE of entire partitions is not supported by that virtual table.
Solutions
- Delete individual rows instead of the whole partition (row deletion may be supported).
- Use SELECT filtering rather than deleting; virtual tables are views over runtime state and often cannot be mutated.
- If you own the virtual table implementation, override applyPartitionDeletion to implement the deletion.
- Stop/adjust the underlying state that the partition reflects (e.g. reset the metric or operation) instead of deleting rows.
Defensive patterns
Strategy: try-catch
Try / catch
try {
session.execute("DELETE FROM system_views.some_table WHERE pk = ?", pk);
} catch (InvalidQueryException e) {
if (e.getMessage().contains("Partition deletion is not supported")) {
// fall back to row-level deletes or manage underlying state instead
}
} Prevention
- Treat virtual tables as read-mostly; check documentation before issuing DELETE/UPDATE.
- Prefer row-level deletes over partition deletes when mutating virtual tables.
- Fix the underlying runtime state rather than deleting the rows that reflect it.
When it happens
Trigger: Executing 'DELETE FROM <virtual_table> WHERE <full partition key>' (or an equivalent mutation via the driver) against a virtual table whose implementation does not override applyPartitionDeletion(Object[]).
Common situations: Users treating system virtual tables (system_views.*, etc.) like normal tables and issuing full-partition DELETEs; cleanup scripts attempting to purge virtual-table rows by partition.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Partition deletion is not supported by table
- Range deletion is not supported by table
- Range deletion is not supported by table
- Row deletion is not supported by table
- Row deletion is not supported by table
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/206584dbd1389fe1.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/db/virtual/AbstractMutableLazyVirtualTable.java:60
* modification via INSERT/UPDATE, DELETE and TRUNCATE operations.
*
* Virtual table implementation need to be thread-safe has they can be called from different threads.
*/
public abstract class AbstractMutableLazyVirtualTable extends AbstractLazyVirtualTable
{
protected AbstractMutableLazyVirtualTable(TableMetadata metadata, OnTimeout onTimeout, Sorted sorted)
{
super(metadata, onTimeout, sorted);
}
protected AbstractMutableLazyVirtualTable(TableMetadata metadata, OnTimeout onTimeout, Sorted sorted, Sorted sortedByPartitionKey)
{
super(metadata, onTimeout, sorted, sortedByPartitionKey);
}
protected void applyPartitionDeletion(Object[] partitionKeys)
{
throw invalidRequest("Partition deletion is not supported by table %s", metadata());
}
protected void applyRangeTombstone(Object[] partitionKey, Object[] start, boolean startInclusive, Object[] end, boolean endInclusive)
{
throw invalidRequest("Range deletion is not supported by table %s", metadata());
}
protected void applyRowDeletion(Object[] partitionKey, @Nullable Object[] clusteringKeys)
{
throw invalidRequest("Row deletion is not supported by table %s", metadata());
}
protected void applyRowUpdate(Object[] partitionKeys, @Nullable Object[] clusteringKeys, ColumnMetadata[] columns, Object[] values)
{
throw invalidRequest("Column modification is not supported by table %s", metadata());
}
private void applyRangeTombstone(Object[] pks, RangeTombstone rt)View on GitHub (pinned to 88fd0f6a0e)