{"record":{"id":"3b4a472f5c85cec9","repo":"apache/cassandra","slug":"s-is-not-a-parsable-float-for-s","errorCode":null,"errorMessage":"%s is not a parsable float for %s","messagePattern":"(.+?) is not a parsable float for (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategyOptions.java","lineNumber":63,"sourceCode":"    }\n\n    public SizeTieredCompactionStrategyOptions()\n    {\n        minSSTableSize = DEFAULT_MIN_SSTABLE_SIZE;\n        bucketLow = DEFAULT_BUCKET_LOW;\n        bucketHigh = DEFAULT_BUCKET_HIGH;\n    }\n\n    private static double parseDouble(Map<String, String> options, String key, double defaultValue) throws ConfigurationException\n    {\n        String optionValue = options.get(key);\n        try\n        {\n            return optionValue == null ? defaultValue : Double.parseDouble(optionValue);\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(String.format(\"%s is not a parsable float for %s\", optionValue, key), e);\n        }\n    }\n\n    public static Map<String, String> validateOptions(Map<String, String> options, Map<String, String> uncheckedOptions) throws ConfigurationException\n    {\n        String optionValue = options.get(MIN_SSTABLE_SIZE_KEY);\n        try\n        {\n            long minSSTableSize = optionValue == null ? DEFAULT_MIN_SSTABLE_SIZE : Long.parseLong(optionValue);\n            if (minSSTableSize < 0)\n            {\n                throw new ConfigurationException(String.format(\"%s must be non negative: %d\", MIN_SSTABLE_SIZE_KEY, minSSTableSize));\n            }\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(String.format(\"%s is not a parsable int (base10) for %s\", optionValue, MIN_SSTABLE_SIZE_KEY), e);\n        }","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategyOptions.java#L45-L81","documentation":"ConfigurationException raised by SizeTieredCompactionStrategyOptions.parseDouble when a compaction option value (bucket_low or bucket_high) cannot be parsed as a double. It wraps the original NumberFormatException and names both the offending value and the option key so the invalid table option can be corrected. Thrown while validating strategy options at table creation/ALTER time.","triggerScenarios":"CREATE/ALTER TABLE with compaction option 'bucket_low' or 'bucket_high' set to a non-numeric string, e.g. {'class': 'SizeTieredCompactionStrategy', 'bucket_low': '0,5'} (comma decimal separator) or 'bucket_high': 'high'.","commonSituations":"Locale mistakes using ',' as decimal separator instead of '.'; typo or quoted-value mangling in cqlsh; automated config generators emitting empty strings for unset options.","solutions":["Correct the option value to use a decimal point, e.g. bucket_low = '0.5', bucket_high = '1.5'.","Remove the invalid option to fall back to the defaults (0.5 / 1.5).","Fix the emitting script/tool to always serialize doubles with '.' and no locale-specific formatting."],"exampleFix":"// before\nALTER TABLE ks.t WITH compaction = {'class':'SizeTieredCompactionStrategy','bucket_low':'0,5'};\n// after\nALTER TABLE ks.t WITH compaction = {'class':'SizeTieredCompactionStrategy','bucket_low':'0.5'};","handlingStrategy":"validation","validationCode":"function isValidDouble(v) { return v == null || !isNaN(Number(v.replace(',', '.'))) && Number(v.replace(',', '.')) > 0; }\nif (!isValidDouble(opts.bucket_low) || !isValidDouble(opts.bucket_high)) throw new Error('bucket_low/bucket_high must be decimal numbers');","typeGuard":null,"tryCatchPattern":"try { schema.alterTable(cql); } catch (ConfigurationException e) { if (e.getMessage().contains(\"not a parsable float\")) { /* correct the option value and retry */ } else throw e; }","preventionTips":["Always use '.' as the decimal separator in Cassandra options, regardless of locale.","Validate doubles with a regex like ^\\d+(\\.\\d+)?$ before applying schema options.","Prefer omitting options to accept defaults instead of writing computed values."],"tags":["compaction","configuration","number-format"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}