apache/cassandra · error · IllegalStateException
The compression on table %s.%s is not enabled or SSTable com
Error message
The compression on table %s.%s is not enabled or SSTable compressor is not a dictionary compressor.
What it means
importCompressionDictionary() only works when the target table currently has dictionary compression enabled and its SSTable compressor is a dictionary compressor (isEnabled && kind != null). Otherwise the manager cannot accept or place an imported dictionary, and IllegalStateException is thrown. This is a precondition check performed before parsing the incoming CompositeData.
Source
Thrown at src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java:269
return CompressionDictionaryDetailsTabularData.fromCompressionDictionary(keyspaceName, tableName, tableId, compressionDictionary);
}
@Override
public CompositeData getCompressionDictionary(long dictId)
{
CompressionDictionary compressionDictionary = SystemDistributedKeyspace.retrieveCompressionDictionary(keyspaceName, tableName, tableId, dictId);
if (compressionDictionary == null)
return null;
return CompressionDictionaryDetailsTabularData.fromCompressionDictionary(keyspaceName, tableName, tableId, compressionDictionary);
}
@Override
public synchronized void importCompressionDictionary(CompositeData compositeData)
{
if (!isEnabled || this.kind == null)
{
throw new IllegalStateException(format("The compression on table %s.%s is not enabled or SSTable compressor is not a dictionary compressor.",
keyspaceName, tableName));
}
CompressionDictionaryDataObject dataObject = CompressionDictionaryDetailsTabularData.fromCompositeData(compositeData);
if (!keyspaceName.equals(dataObject.keyspace) || !tableName.equals(dataObject.table))
throw new IllegalArgumentException(format("Keyspace and table of a dictionary to import (%s.%s) does not correspond to the keyspace and table this manager is responsible for (%s.%s)",
dataObject.keyspace, dataObject.table,
keyspaceName, tableName));
CompressionDictionary.Kind kind = CompressionDictionary.Kind.valueOf(dataObject.kind);
if (this.kind != kind)
{
throw new IllegalArgumentException(format("It is not possible to import compression dictionaries of kind " +
"%s into table %s.%s which supports compression dictionaries of kind %s.",
kind, keyspaceName, tableName, this.kind));
}View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Enable dictionary compression on the target table first (ALTER TABLE ... WITH compression = {'class': '<dictionary compressor>', ...}).
- Verify with DESCRIBE TABLE that the compression class is a dictionary compressor before importing.
- Ensure the import is targeting the same table the dictionary was trained/exported from.
- If the feature flag for compression dictionaries is disabled on the node, enable it in cassandra.yaml / via the appropriate config.
Example fix
// before
manager.importCompressionDictionary(compositeData); // IllegalStateException on non-dictionary table
// after
ALTER TABLE ks.tbl WITH compression = {'class': 'org.apache.cassandra.io.compress.ZstdDictionaryCompressor'};
// then re-run the import
manager.importCompressionDictionary(compositeData); Defensive patterns
Strategy: validation
Validate before calling
if (manager.isEnabled && manager.getCurrentKind() != null) manager.importCompressionDictionary(data);
Try / catch
try { manager.importCompressionDictionary(data); } catch (IllegalStateException e) { /* enable dictionary compression on the table first */ } Prevention
- Confirm the target table's compression is a dictionary compressor before importing
- Keep the feature enabled on all nodes that receive imports
- Import only into the same table the dictionary was trained on
When it happens
Trigger: Calling importCompressionDictionary(CompositeData) on a table where dictionary compression is disabled (isEnabled == false) or where the current compressor is not a dictionary compressor (this.kind == null).
Common situations: Importing a dictionary into a table whose compression was switched to a plain compressor; importing into a table that never had dictionary compression enabled; running the import on the wrong table/keyspace by mistake; importing before the dictionary feature was enabled on the target cluster.
Related errors
- Computed checksum of dictionary to import (%s) is different
- Keyspace and table of a dictionary to import (%s.%s) does no
- It is not possible to import compression dictionaries of kin
- Dictionary to import has older dictionary id (%s) than the l
- compressed_read_ahead_buffer_size must be at least 256KiB (s
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/254519aca32573cd.
Report an issue: GitHub.