apache/cassandra · error · InvalidRequestException

Partitioner ' ' for table ' ' in keyspace ' ' is not…

Error message

Partitioner '%s' for table '%s' in keyspace '%s' is not supported.

What it means

The partition_key_stats table computes ranges by splitting the partitioner's token space, which only some partitioners support (e.g. Murmur3 and RandomPartitioner). In select(), if metadata.partitioner.supportsSplitting() is false, this InvalidRequestException is thrown naming the partitioner class, table, and keyspace.

Solutions

  1. Restrict partition_key_stats queries to tables using a splitting partitioner (Murmur3Partitioner).
  2. Migrate the target table to Murmur3Partitioner if full stats support is required.
  3. Skip the table in stats-collection tooling when supportsSplitting is false.
  4. If a custom partitioner is in use, implement/enable supportsSplitting or exclude it from analysis.

Example fix

// before
-- stats query against table using ByteOrderedPartitioner -> rejected
// after
-- confirm partitioner first:
SELECT partitioner FROM system_schema.tables WHERE keyspace_name = 'ks' AND table_name = 'tbl';
-- only query Murmur3Partitioner tables
Defensive patterns

Strategy: validation

Validate before calling

Row r = session.execute("SELECT partitioner FROM system_schema.tables WHERE keyspace_name = ? AND table_name = ?", ks, tbl).one();
if (r != null && !r.getString("partitioner").endsWith("Murmur3Partitioner"))
    throw new IllegalStateException("Partitioner does not support splitting: " + r.getString("partitioner"));

Try / catch

try { session.execute(statsQuery); }
catch (InvalidRequestException e) { if (e.getMessage().contains("is not supported")) { /* exclude this table from stats analysis */ } else throw e; }

Prevention

When it happens

Trigger: Querying partition_key_stats for a table that uses a partitioner without split support — notably OrderedPartitioner or ByteOrderedPartitioner based tables, or any custom partitioner not implementing supportsSplitting.

Common situations: Environments with tables migrated from older ordered-partitioner clusters; custom partitioner deployments; stats tooling pointed at non-Murmur3 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/98030caff53bd2e7. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/db/virtual/PartitionKeyStatsTable.java:169

    public UnfilteredPartitionIterator select(DecoratedKey partitionKey, ClusteringIndexFilter clusteringIndexFilter, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits)
    {
        if (clusteringIndexFilter.isReversed())
            throw new InvalidRequestException(REVERSED_QUERY_ERROR);

        ByteBuffer[] key = ((CompositeType) this.metadata.partitionKeyType).split(partitionKey.getKey());
        String keyspace = UTF8Type.instance.getString(key[0]);
        String table = UTF8Type.instance.getString(key[1]);

        KeyspaceMetadata ksm = Schema.instance.getKeyspaceMetadata(keyspace);
        if (ksm == null)
            throw invalidRequest(KEYSPACE_NOT_EXIST_ERROR, keyspace);

        TableMetadata metadata = ksm.getTableOrViewNullable(table);
        if (metadata == null)
            throw invalidRequest(TABLE_NOT_EXIST_ERROR, table, keyspace);

        if (!metadata.partitioner.supportsSplitting())
            throw invalidRequest(PARTITIONER_NOT_SUPPORTED, metadata.partitioner.getClass().getName(), table, keyspace);

        AbstractBounds<PartitionPosition> range = getBounds(metadata, clusteringIndexFilter, rowFilter);
        return new SingletonUnfilteredPartitionIterator(select(partitionKey, metadata, clusteringIndexFilter, range));
    }

    private List<SSTableReader> getSStables(TableMetadata metadata, AbstractBounds<PartitionPosition> range)
    {
        return Lists.newArrayList(ColumnFamilyStore.getIfExists(metadata).getTracker().getView().liveSSTablesInBounds(range.left, range.right));
    }

    private UnfilteredRowIterator select(DecoratedKey partitionKey, TableMetadata metadata, ClusteringIndexFilter clusteringIndexFilter, AbstractBounds<PartitionPosition> range)
    {
        List<SSTableReader> sstables = getSStables(metadata, range);
        if (sstables.isEmpty())
            return UnfilteredRowIterators.noRowsIterator(metadata, partitionKey, Rows.EMPTY_STATIC_ROW, DeletionTime.LIVE, false);

        List<UnfilteredRowIterator> sstableIterators = Lists.newArrayList();
        for (SSTableReader sstable : sstables)

View on GitHub (pinned to 88fd0f6a0e)