apache/cassandra · error · InvalidRequestException

Partition deletion is not supported by table

Error message

Partition deletion is not supported by table %s

What it means

AbstractMutableVirtualTable's default applyPartitionDeletion throws this invalid-request error: partition-level DELETEs are not supported unless the concrete virtual table overrides the method with ColumnValues-based semantics. The table metadata is included in the message.

Solutions

  1. Delete individual rows instead (if row deletion is supported).
  2. Avoid DELETE on this virtual table and manage the underlying state directly.
  3. If you implement the table, override applyPartitionDeletion(ColumnValues) to support partition deletes.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    session.execute("DELETE FROM some_virtual_table WHERE pk = ?", pk);
} catch (InvalidQueryException e) {
    if (e.getMessage().contains("Partition deletion is not supported")) {
        // fall back to row-level deletes or address the underlying state
    }
}

Prevention

When it happens

Trigger: Running 'DELETE FROM <virtual_table> WHERE <complete partition key>' against a virtual table extending AbstractMutableVirtualTable without an applyPartitionDeletion override.

Common situations: Users cleaning up virtual-table partitions; drivers issuing implicit partition deletes (e.g. DELETE with only the partition key specified); scripts ported from normal-table maintenance to virtual tables.

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/eac7d9838f5ce7eb. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/db/virtual/AbstractMutableVirtualTable.java:110

                else
                    applyRowDeletion(partitionKey, clusteringColumns);
            });
        else
        {
            // MutableDeletionInfo may have partition delete or range tombstone list or both
            if (update.deletionInfo().hasRanges())
                update.deletionInfo()
                        .rangeIterator(false)
                        .forEachRemaining(rt -> applyRangeTombstone(partitionKey, toRange(rt.deletedSlice())));

            if (!update.deletionInfo().getPartitionDeletion().isLive())
                applyPartitionDeletion(partitionKey);
        }
    }

    protected void applyPartitionDeletion(ColumnValues partitionKey)
    {
        throw invalidRequest("Partition deletion is not supported by table %s", metadata);
    }

    private Range<ColumnValues> toRange(Slice slice)
    {
        ClusteringBound<?> startBound = slice.start();
        ClusteringBound<?> endBound = slice.end();

        if (startBound.isBottom())
        {
            if (endBound.isTop())
                return Range.all();

            return Range.upTo(ColumnValues.from(metadata(), endBound), boundType(endBound));
        }

        if (endBound.isTop())
            return Range.downTo(ColumnValues.from(metadata(), startBound), boundType(startBound));

View on GitHub (pinned to 88fd0f6a0e)