apache/cassandra · error · ConfigurationException
is not a parsable float for
Error message
%s is not a parsable float for %s
What it means
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.
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.
Example fix
// before
ALTER TABLE ks.t WITH compaction = {'class':'SizeTieredCompactionStrategy','bucket_low':'0,5'};
// after
ALTER TABLE ks.t WITH compaction = {'class':'SizeTieredCompactionStrategy','bucket_low':'0.5'}; Defensive patterns
Strategy: validation
Validate before calling
function isValidDouble(v) { return v == null || !isNaN(Number(v.replace(',', '.'))) && Number(v.replace(',', '.')) > 0; }
if (!isValidDouble(opts.bucket_low) || !isValidDouble(opts.bucket_high)) throw new Error('bucket_low/bucket_high must be decimal numbers'); Try / catch
try { schema.alterTable(cql); } catch (ConfigurationException e) { if (e.getMessage().contains("not a parsable float")) { /* correct the option value and retry */ } else throw e; } Prevention
- 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.
When it happens
Trigger: 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'.
Common situations: Locale mistakes using ',' as decimal separator instead of '.'; typo or quoted-value mangling in cqlsh; automated config generators emitting empty strings for unset options.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- is not a parsable int (base10) for
- At most bytes may be in a compaction level; your…
- Cannot set concurrent_validations greater than…
- compaction_throughput: is too large; it should be less than…
- concurrent_compactors should be strictly greater than 0…
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/3b4a472f5c85cec9.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategyOptions.java:63
}
public SizeTieredCompactionStrategyOptions()
{
minSSTableSize = DEFAULT_MIN_SSTABLE_SIZE;
bucketLow = DEFAULT_BUCKET_LOW;
bucketHigh = DEFAULT_BUCKET_HIGH;
}
private static double parseDouble(Map<String, String> options, String key, double defaultValue) throws ConfigurationException
{
String optionValue = options.get(key);
try
{
return optionValue == null ? defaultValue : Double.parseDouble(optionValue);
}
catch (NumberFormatException e)
{
throw new ConfigurationException(String.format("%s is not a parsable float for %s", optionValue, key), e);
}
}
public static Map<String, String> validateOptions(Map<String, String> options, Map<String, String> uncheckedOptions) throws ConfigurationException
{
String optionValue = options.get(MIN_SSTABLE_SIZE_KEY);
try
{
long minSSTableSize = optionValue == null ? DEFAULT_MIN_SSTABLE_SIZE : Long.parseLong(optionValue);
if (minSSTableSize < 0)
{
throw new ConfigurationException(String.format("%s must be non negative: %d", MIN_SSTABLE_SIZE_KEY, minSSTableSize));
}
}
catch (NumberFormatException e)
{
throw new ConfigurationException(String.format("%s is not a parsable int (base10) for %s", optionValue, MIN_SSTABLE_SIZE_KEY), e);
}View on GitHub (pinned to 88fd0f6a0e)