apache/cassandra · error · ConfigurationException

case_sensitive option cannot be specified together with eith

Error message

case_sensitive option cannot be specified together with either normalize_lowercase or normalize_uppercase

What it means

NonTokenizingAnalyzer.validate rejects SASI index options where 'case_sensitive' is set together with 'normalize_lowercase' or 'normalize_uppercase'. Normalization implies case is not preserved, so combining it with case-sensitive matching is contradictory and the analyzer refuses the configuration with a ConfigurationException.

Source

Thrown at src/java/org/apache/cassandra/index/sasi/analyzer/NonTokenizingAnalyzer.java:68

            add(UTF8Type.instance);
            add(AsciiType.instance);
    }};

    private AbstractType<?> validator;
    private NonTokenizingOptions options;
    private FilterPipelineTask filterPipeline;

    private ByteBuffer input;
    private boolean hasNext = false;

    @Override
    public void validate(Map<String, String> options, ColumnMetadata cm) throws ConfigurationException
    {
        super.validate(options, cm);
        if (options.containsKey(NonTokenizingOptions.CASE_SENSITIVE) &&
            (options.containsKey(NonTokenizingOptions.NORMALIZE_LOWERCASE)
             || options.containsKey(NonTokenizingOptions.NORMALIZE_UPPERCASE)))
            throw new ConfigurationException("case_sensitive option cannot be specified together " +
                                               "with either normalize_lowercase or normalize_uppercase");
    }

    public void init(Map<String, String> options, AbstractType<?> validator)
    {
        init(NonTokenizingOptions.buildFromMap(options), validator);
    }

    public void init(NonTokenizingOptions tokenizerOptions, AbstractType<?> validator)
    {
        this.validator = validator;
        this.options = tokenizerOptions;
        this.filterPipeline = getFilterPipeline();
    }

    public boolean hasNext()
    {
        // check that we know how to handle the input, otherwise bail

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Remove 'case_sensitive' and keep one of normalize_lowercase/normalize_uppercase
  2. Remove the normalize_lowercase/normalize_uppercase option and keep case_sensitive
  3. Validate the option map before issuing CREATE CUSTOM INDEX

Example fix

// before
OPTIONS = {'case_sensitive': 'true', 'normalize_lowercase': 'true'}
// after
OPTIONS = {'normalize_lowercase': 'true'}
Defensive patterns

Strategy: validation

Validate before calling

Map<String,String> o = indexOptions;
boolean cs = o.containsKey("case_sensitive");
boolean norm = o.containsKey("normalize_lowercase") || o.containsKey("normalize_uppercase");
if (cs && norm) throw new ConfigurationException("case_sensitive is mutually exclusive with normalize_lowercase/normalize_uppercase");

Try / catch

try { session.execute(createIndexCql); } catch (ConfigurationException e) { if (e.getMessage().contains("case_sensitive option cannot")) { removeConflictingOptions(options); session.execute(rebuildCql(options)); } else throw e; }

Prevention

When it happens

Trigger: CREATE CUSTOM INDEX ... WITH OPTIONS = {'case_sensitive': 'true', 'normalize_lowercase': 'true'} (or normalize_uppercase) on a SASI NonTokenizingAnalyzer index; validate() is called at index-creation time.

Common situations: Copy-pasting option blocks that include both case sensitivity and normalization flags; assuming normalization and case_sensitive are independent knobs.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/5d8dfb02e535e812. Report an issue: GitHub.