{"record":{"id":"93a4ab74e0c39be4","repo":"apache/cassandra","slug":"argument-must-have-keyspace-and-table-values","errorCode":null,"errorMessage":"Argument must have keyspace and table values.","messagePattern":"Argument must have keyspace and table values\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":2813,"sourceCode":"        return doWithCompressionDictionaryManagerMBean(proxy -> proxy.getCompressionDictionary(dictId), keyspace, table);\n    }\n\n    /**\n     * Imports dictionary in composite data to database.\n     *\n     * @param compositeData data to import\n     * @throws IOException if there's an error accessing the MBean\n     * @throws IllegalArgumentException if keyspace and table values in compositeData are missing\n     * or if table doesn't support dictionary compression\n     */\n    public void importCompressionDictionary(CompositeData compositeData) throws IOException\n    {\n        String keyspace = (String) compositeData.get(CompressionDictionaryDetailsTabularData.KEYSPACE_NAME);\n        String table = (String) compositeData.get(CompressionDictionaryDetailsTabularData.TABLE_NAME);\n\n        if (keyspace == null || table == null)\n        {\n            throw new IllegalArgumentException(\"Argument must have keyspace and table values.\");\n        }\n\n        doWithCompressionDictionaryManagerMBean(proxy -> { proxy.importCompressionDictionary(compositeData); return null; }, keyspace, table);\n    }\n\n    /**\n     *\n     * @param keyspace keyspace to list dictionaries for\n     * @param table table to list dictionaries for\n     * @return tabular data with listing\n     * @throws IOException if there's an error accessing the MBean\n     * @throws IllegalArgumentException if table doesn't support dictionary compression\n     */\n    public TabularData listCompressionDictionaries(String keyspace, String table) throws IOException\n    {\n        return doWithCompressionDictionaryManagerMBean(CompressionDictionaryManagerMBean::listCompressionDictionaries, keyspace, table);\n    }\n","sourceCodeStart":2795,"sourceCodeEnd":2831,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L2795-L2831","documentation":"When importing a compression dictionary, NodeProbe reads the keyspace and table names out of the supplied CompositeData. If either is null, the data cannot be routed to the correct CompressionDictionaryManager MBean, so an IllegalArgumentException is thrown immediately.","triggerScenarios":"Calling nodetool's compression dictionary import (importCompressionDictionary) with a CompositeData payload missing the KEYSPACE_NAME or TABLE_NAME entries.","commonSituations":"Hand-crafted or generated import payload missing required columns; programmatic JMX callers building CompositeData with wrong keys; CSV/JSON import tooling that omits fields.","solutions":["Ensure the CompositeData includes non-null KEYSPACE_NAME and TABLE_NAME items before import.","Use the documented nodetool import syntax so the payload is built correctly.","Validate the input file/payload fields (keyspace and table present, correct case) before calling import."],"exampleFix":"// before\nCompositeData data = ...; // missing TABLE_NAME entry\n// after\nMap<String,Object> items = new HashMap<>(data); // or build data with both\nitems.put(CompressionDictionaryDetailsTabularData.TABLE_NAME, \"mytable\");","handlingStrategy":"validation","validationCode":"if (data == null) throw new IllegalArgumentException(\"CompositeData is required\");\nObject ks = data.get(CompressionDictionaryDetailsTabularData.KEYSPACE_NAME);\nObject tbl = data.get(CompressionDictionaryDetailsTabularData.TABLE_NAME);\nif (ks == null || tbl == null) throw new IllegalArgumentException(\"keyspace and table must be set in the payload\");","typeGuard":"boolean isNonBlank(String s) { return s != null && !s.isBlank(); }","tryCatchPattern":null,"preventionTips":["Build import payloads via the documented helper/TabularData builder, never by hand","Validate payload fields before JMX invocation","Log the payload contents on failure for diagnosis"],"tags":["jmx","nodetool","argument-validation","compression-dictionary"],"backgroundTag":"missing-required-argument","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"}