apache/cassandra · error · InvalidRequestException

Range deletion is not supported by table

Error message

Range deletion is not supported by table %s

What it means

The default applyRangeTombstone implementation of AbstractMutableLazyVirtualTable throws this error because range deletions (deleting a contiguous range of clustering rows within a partition) are not supported unless the concrete virtual table overrides the method.

Solutions

  1. Delete explicit rows one-by-one (or via IN clauses) if row deletion is supported by the table.
  2. Remove the range predicate and delete only whole rows with fully specified clustering keys.
  3. If you implement the virtual table, override applyRangeTombstone to support range deletions.

Example fix

// before
DELETE FROM system_views.some_table WHERE pk = 1 AND ck > 10 AND ck < 20;
// after
DELETE FROM system_views.some_table WHERE pk = 1 AND ck = 11;
DELETE FROM system_views.some_table WHERE pk = 1 AND ck = 12;
Defensive patterns

Strategy: try-catch

Try / catch

try {
    session.execute(rangeDelete);
} catch (InvalidQueryException e) {
    if (e.getMessage().contains("Range deletion is not supported")) {
        // fall back to deleting explicit rows with IN (...)
    }
}

Prevention

When it happens

Trigger: Executing a range DELETE such as 'DELETE FROM <virtual_table> WHERE pk = ? AND ck > ? AND ck < ?' (or DELETE ... WHERE ck >= / <=) against a virtual table that has not overridden applyRangeTombstone(Object[], Object[], boolean, Object[], boolean).

Common situations: Cleanup queries that delete row ranges from virtual tables; ORMs or drivers that translate bounded DELETE statements into range tombstones.

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


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/3d5825da0c270eff. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/db/virtual/AbstractMutableLazyVirtualTable.java:65

{
    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)
    {
        Slice slice = rt.deletedSlice();
        Object[] starts = composeClusterings(slice.start(), metadata());
        Object[] ends = composeClusterings(slice.end(), metadata());
        applyRangeTombstone(pks, starts, slice.start().isInclusive(), ends, slice.end().isInclusive());

View on GitHub (pinned to 88fd0f6a0e)