{"record":{"id":"c22da8ec07d56ac1","repo":"apache/cassandra","slug":"the-s-option-must-not-be-empty-to-disable-comp","errorCode":null,"errorMessage":"The '%s' option must not be empty. To disable compression use 'enabled' : false","messagePattern":"The '(.+?)' option must not be empty\\. To disable compression use 'enabled' : false","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/schema/CompressionParams.java","lineNumber":422,"sourceCode":"            return Double.parseDouble(ratio);\n        }\n        return DEFAULT_MIN_COMPRESS_RATIO;\n    }\n\n    /**\n     * Removes the option specifying the name of the compression class\n     *\n     * @param options the options\n     * @return the name of the compression class\n     */\n    private static String removeSSTableCompressionClass(Map<String, String> options)\n    {\n        if (options.containsKey(CLASS))\n        {\n            String clazz = options.remove(CLASS);\n\n            if (clazz == null || clazz.isEmpty())\n                throw new ConfigurationException(format(\"The '%s' option must not be empty. To disable compression use 'enabled' : false\", CLASS));\n\n            return clazz;\n        }\n\n        return null;\n    }\n\n    /**\n     * Returns {@code true} if the options contains the {@code enabled} option and that its value is\n     * {@code true}, otherwise returns {@code false}.\n     *\n     * @param options the options\n     * @return {@code true} if the options contains the {@code enabled} option and that its value is\n     * {@code true}, otherwise returns {@code false}.\n     */\n    public static boolean isEnabled(Map<String, String> options)\n    {\n        String enabled = options.get(ENABLED);","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/schema/CompressionParams.java#L404-L440","documentation":"removeSSTableClassOption rejects a compression map where the 'class' key is present but empty or null, because Cassandra cannot resolve an ICompressor implementation from an empty class name. The message points to the correct way to disable compression: 'enabled' : false.","triggerScenarios":"Calling CompressionParams.fromMap with options containing {'class': ''} or {'class': null} (key present, value empty).","commonSituations":"Programmatic schema builders concatenating maps and leaving class blank; YAML/cqlsh configs where a placeholder value was never filled in; tooling that strips the class name but keeps the key.","solutions":["Set 'class' to a valid compressor class, e.g. 'org.apache.cassandra.io.compress.LZ4Compressor'","To disable compression entirely, use {'enabled': 'false'} instead of an empty class","Remove the empty 'class' key so defaults are applied"],"exampleFix":"// before\n{'class': ''}\n// after\n{'enabled': 'false'}","handlingStrategy":"validation","validationCode":"if (opts.containsKey(\"class\") && (opts.get(\"class\") == null || opts.get(\"class\").isEmpty())) throw new IllegalArgumentException(\"class must not be empty; use {'enabled':'false'} to disable\");","typeGuard":null,"tryCatchPattern":"try { params = CompressionParams.fromMap(opts); } catch (ConfigurationException e) { log.error(\"empty compression class\", e); }","preventionTips":["Use {'enabled': 'false'} to disable compression, never an empty class key","Check for empty-string values when merging compression option maps","Write a config lint test that fails on empty 'class' values"],"tags":["config","compression","validation"],"backgroundTag":"empty-required-field","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"}