{"record":{"id":"003c5bde1dd25a85","repo":"apache/cassandra","slug":"keyspace-and-table-of-a-dictionary-to-import-s","errorCode":null,"errorMessage":"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)","messagePattern":"Keyspace and table of a dictionary to import \\((.+?)\\.(.+?)\\) does not correspond to the keyspace and table this manager is responsible for \\((.+?)\\.(.+?)\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java","lineNumber":276,"sourceCode":"        if (compressionDictionary == null)\n            return null;\n\n        return CompressionDictionaryDetailsTabularData.fromCompressionDictionary(keyspaceName, tableName, tableId, compressionDictionary);\n    }\n\n    @Override\n    public synchronized void importCompressionDictionary(CompositeData compositeData)\n    {\n        if (!isEnabled || this.kind == null)\n        {\n            throw new IllegalStateException(format(\"The compression on table %s.%s is not enabled or SSTable compressor is not a dictionary compressor.\",\n                                                   keyspaceName, tableName));\n        }\n\n        CompressionDictionaryDataObject dataObject = CompressionDictionaryDetailsTabularData.fromCompositeData(compositeData);\n\n        if (!keyspaceName.equals(dataObject.keyspace) || !tableName.equals(dataObject.table))\n            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)\",\n                                                      dataObject.keyspace, dataObject.table,\n                                                      keyspaceName, tableName));\n\n        CompressionDictionary.Kind kind = CompressionDictionary.Kind.valueOf(dataObject.kind);\n\n        if (this.kind != kind)\n        {\n            throw new IllegalArgumentException(format(\"It is not possible to import compression dictionaries of kind \" +\n                                                      \"%s into table %s.%s which supports compression dictionaries of kind %s.\",\n                                                      kind, keyspaceName, tableName, this.kind));\n        }\n\n        CompressionDictionary.DictId dictId = new CompressionDictionary.DictId(kind, dataObject.dictId);\n\n        LightweightCompressionDictionary latestCompressionDictionary = retrieveLightweightLatestCompressionDictionary(keyspaceName, tableName, tableId);\n        if (latestCompressionDictionary != null)\n        {\n            if (latestCompressionDictionary.dictId.id > dictId.id)","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java#L258-L294","documentation":"The imported dictionary's CompositeData carries its own keyspace and table names. importCompressionDictionary() rejects the payload with IllegalArgumentException when those names do not match the keyspace/table this manager instance is responsible for, preventing a dictionary trained for one table from being installed on another.","triggerScenarios":"Calling importCompressionDictionary with a CompositeData whose dataObject.keyspace or dataObject.table differs from the manager's keyspaceName/tableName — e.g. posting table A's dictionary to table B's MBean.","commonSituations":"Using the wrong JMX object name when importing; exporting a dictionary from one table and importing it into another; typos in keyspace/table names inside hand-built CompositeData; case-sensitivity mistakes with quoted identifiers.","solutions":["Target the MBean/manager of the exact keyspace.table the dictionary came from.","Re-export the dictionary with correct keyspace/table metadata matching the destination.","Fix the keyspace and table fields in the CompressionDictionaryDataObject to match the target table (only if the dictionary truly belongs to it).","Watch case sensitivity: quoted identifiers in CQL are case-sensitive."],"exampleFix":"// before\n// dictionary for ks.tbl1 imported into ks.tbl2's manager\nks2Manager.importCompressionDictionary(tbl1Data);\n// after\nMBeanServerConnection mbs = ...;\nObjectName on = new ObjectName(\"org.apache.cassandra.db:type=CompressionDictionaryManager,keyspace=ks,table=tbl1\");\nmbs.invoke(on, \"importCompressionDictionary\", new Object[]{tbl1Data}, new String[]{javax.management.openmbean.CompositeData.class.getName()});","handlingStrategy":"validation","validationCode":"if (keyspace.equals(dataObject.keyspace) && table.equals(dataObject.table)) manager.importCompressionDictionary(data);","typeGuard":null,"tryCatchPattern":"try { manager.importCompressionDictionary(data); } catch (IllegalArgumentException e) { /* wrong table: route to correct manager/MBean */ }","preventionTips":["Resolve the manager/MBean by keyspace+table from the dictionary payload","Never reuse an export file across different tables","Match identifier case exactly (quoted identifiers are case-sensitive)"],"tags":["compression","dictionary-import","argument-mismatch"],"backgroundTag":"invalid-argument-value","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"}