{"record":{"id":"5d8dfb02e535e812","repo":"apache/cassandra","slug":"case-sensitive-option-cannot-be-specified-together","errorCode":null,"errorMessage":"case_sensitive option cannot be specified together with either normalize_lowercase or normalize_uppercase","messagePattern":"case_sensitive option cannot be specified together with either normalize_lowercase or normalize_uppercase","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/index/sasi/analyzer/NonTokenizingAnalyzer.java","lineNumber":68,"sourceCode":"            add(UTF8Type.instance);\n            add(AsciiType.instance);\n    }};\n\n    private AbstractType<?> validator;\n    private NonTokenizingOptions options;\n    private FilterPipelineTask filterPipeline;\n\n    private ByteBuffer input;\n    private boolean hasNext = false;\n\n    @Override\n    public void validate(Map<String, String> options, ColumnMetadata cm) throws ConfigurationException\n    {\n        super.validate(options, cm);\n        if (options.containsKey(NonTokenizingOptions.CASE_SENSITIVE) &&\n            (options.containsKey(NonTokenizingOptions.NORMALIZE_LOWERCASE)\n             || options.containsKey(NonTokenizingOptions.NORMALIZE_UPPERCASE)))\n            throw new ConfigurationException(\"case_sensitive option cannot be specified together \" +\n                                               \"with either normalize_lowercase or normalize_uppercase\");\n    }\n\n    public void init(Map<String, String> options, AbstractType<?> validator)\n    {\n        init(NonTokenizingOptions.buildFromMap(options), validator);\n    }\n\n    public void init(NonTokenizingOptions tokenizerOptions, AbstractType<?> validator)\n    {\n        this.validator = validator;\n        this.options = tokenizerOptions;\n        this.filterPipeline = getFilterPipeline();\n    }\n\n    public boolean hasNext()\n    {\n        // check that we know how to handle the input, otherwise bail","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/index/sasi/analyzer/NonTokenizingAnalyzer.java#L50-L86","documentation":"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.","triggerScenarios":"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.","commonSituations":"Copy-pasting option blocks that include both case sensitivity and normalization flags; assuming normalization and case_sensitive are independent knobs.","solutions":["Remove 'case_sensitive' and keep one of normalize_lowercase/normalize_uppercase","Remove the normalize_lowercase/normalize_uppercase option and keep case_sensitive","Validate the option map before issuing CREATE CUSTOM INDEX"],"exampleFix":"// before\nOPTIONS = {'case_sensitive': 'true', 'normalize_lowercase': 'true'}\n// after\nOPTIONS = {'normalize_lowercase': 'true'}","handlingStrategy":"validation","validationCode":"Map<String,String> o = indexOptions;\nboolean cs = o.containsKey(\"case_sensitive\");\nboolean norm = o.containsKey(\"normalize_lowercase\") || o.containsKey(\"normalize_uppercase\");\nif (cs && norm) throw new ConfigurationException(\"case_sensitive is mutually exclusive with normalize_lowercase/normalize_uppercase\");","typeGuard":null,"tryCatchPattern":"try { session.execute(createIndexCql); } catch (ConfigurationException e) { if (e.getMessage().contains(\"case_sensitive option cannot\")) { removeConflictingOptions(options); session.execute(rebuildCql(options)); } else throw e; }","preventionTips":["Never mix case_sensitive with normalize_* options","Centralize SASI option-map construction in one validated helper"],"tags":["sasi","index-options","conflicting-options","configuration"],"backgroundTag":"conflicting-config-options","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"}