{"record":{"id":"68ad883eaad2e0e6","repo":"apache/cassandra","slug":"table-keyspacename-tablename-does-not-support","errorCode":null,"errorMessage":"Table <keyspaceName>.<tableName> does not support dictionary compression","messagePattern":"Table <keyspaceName>\\.<tableName> does not support dictionary compression","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java","lineNumber":180,"sourceCode":"    @Override\n    public void onNewDictionaryTrained(CompressionDictionary.DictId dictionaryId)\n    {\n        eventHandler.onNewDictionaryTrained(dictionaryId);\n    }\n\n    @Override\n    public void onNewDictionaryAvailable(CompressionDictionary.DictId dictionaryId)\n    {\n        eventHandler.onNewDictionaryAvailable(dictionaryId);\n    }\n\n    @Override\n    public synchronized void train(boolean force, Map<String, String> parameters)\n    {\n        // Validate table supports dictionary compression\n        if (!isEnabled)\n        {\n            throw new UnsupportedOperationException(\"Table \" + keyspaceName + '.' + tableName + \" does not support dictionary compression\");\n        }\n\n        // resolve training config and fail fast when invalid, so we do not reach logic which would e.g. flush unnecessarily.\n        CompressionDictionaryTrainingConfig trainingConfig = createTrainingConfig(parameters);\n\n        LightweightCompressionDictionary dictionary = retrieveLightweightLatestCompressionDictionary(columnFamilyStore.getKeyspaceName(),\n                                                                                                     columnFamilyStore.getTableName(),\n                                                                                                     columnFamilyStore.metadata.id.toLongString());\n\n        checkTrainingFrequency(dictionary, trainingConfig);\n\n        // SSTable-based training: sample from existing SSTables\n\n        // this is not closed here but in training runnable when finished\n        // also, if view is empty, and we throw just below because of it then\n        // there is nothing to \"release\" so close is not necessary\n        ColumnFamilyStore.RefViewFragment refViewFragment = columnFamilyStore.selectAndReference(View.selectFunction(SSTableSet.CANONICAL));\n","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java#L162-L198","documentation":"CompressionDictionaryManager.train() refuses to start dictionary training when dictionary compression is not enabled for the table (isEnabled is false). Training requires an active dictionary-capable compression configuration, so the call fails fast with UnsupportedOperationException rather than proceeding.","triggerScenarios":"Calling CompressionDictionaryManager.train(force, parameters) — directly or via JMX — on a table whose compression parameters are not a dictionary-capable compressor (e.g. default LZ4/Snappy/Deflate without the dictionary compressor, or dictionary support disabled for the table).","commonSituations":"Running the training JMX operation against a table that was never created with the dictionary compression option; table compression was altered back to a non-dictionary compressor; tests/automation applying training to all tables indiscriminately.","solutions":["Enable dictionary compression on the table (e.g. ALTER TABLE ... WITH compression = { 'class': '<dictionary-capable compressor>' }) before training.","Check the table's current compression settings with DESCRIBE TABLE or the schema tables to confirm the compressor supports dictionaries.","Skip the table in automation when dictionary compression is not enabled.","Upgrade/reconfigure to a Cassandra build that supports compression dictionaries if the feature is unavailable."],"exampleFix":"// before\ncfs.getCompressionDictionaryManager().train(true, Map.of()); // fails on non-dictionary table\n// after\nALTER TABLE ks.tbl WITH compression = {'class': 'org.apache.cassandra.io.compress.ZstdDictionaryCompressor'};\nif (manager.isEnabled) manager.train(true, Map.of());","handlingStrategy":"validation","validationCode":"if (manager.isEnabled) manager.train(force, params); else logger.warn(\"Skipping training: dictionary compression disabled for table\");","typeGuard":null,"tryCatchPattern":"try { manager.train(force, params); } catch (UnsupportedOperationException e) { /* table lacks dictionary compression: enable or skip */ }","preventionTips":["Verify table compression class supports dictionaries before training","Enumerate eligible tables in automation rather than training all tables","Keep compression config consistent across environments"],"tags":["compression","training","unsupported-operation"],"backgroundTag":"feature-not-enabled","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}