{"record":{"id":"3f38d16d8cc69036","repo":"apache/cassandra","slug":"storage-attached-index-does-not-support-the-follow","errorCode":null,"errorMessage":"Storage-attached index does not support the following IPartitioner implementations: ","messagePattern":"Storage-attached index does not support the following IPartitioner implementations: ","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/index/sai/StorageAttachedIndex.java","lineNumber":243,"sourceCode":"    {\n        Map<String, String> unknown = new HashMap<>(2);\n\n        for (Map.Entry<String, String> option : options.entrySet())\n        {\n            if (!VALID_OPTIONS.contains(option.getKey()))\n            {\n                unknown.put(option.getKey(), option.getValue());\n            }\n        }\n\n        if (!unknown.isEmpty())\n        {\n            return unknown;\n        }\n\n        if (ILLEGAL_PARTITIONERS.contains(metadata.partitioner.getClass()))\n        {\n            throw new InvalidRequestException(\"Storage-attached index does not support the following IPartitioner implementations: \" + ILLEGAL_PARTITIONERS);\n        }\n\n        String targetColumn = options.get(IndexTarget.TARGET_OPTION_NAME);\n\n        if (targetColumn == null)\n        {\n            throw new InvalidRequestException(\"Missing target column\");\n        }\n\n        if (targetColumn.split(\",\").length > 1)\n        {\n            throw new InvalidRequestException(\"A storage-attached index cannot be created over multiple columns: \" + targetColumn);\n        }\n\n        Pair<ColumnMetadata, IndexTarget.Type> target = TargetParser.parse(metadata, targetColumn);\n\n        if (target == null)\n        {","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/index/sai/StorageAttachedIndex.java#L225-L261","documentation":"StorageAttachedIndex.validateOptions throws InvalidRequestException when the table's partitioner class is in ILLEGAL_PARTITIONERS (partitioners SAI cannot support). SAI requires partitioners with compatible token ordering/hashing; unsupported ones are rejected at CREATE INDEX time.","triggerScenarios":"CREATE CUSTOM INDEX USING 'StorageAttachedIndex' on a table whose partitioner is one of the unsupported IPartitioner implementations (e.g. RandomPartitioner, ByteOrderedPartitioner or other legacy/custom partitioners).","commonSituations":"Legacy clusters using ByteOrderedPartitioner or RandomPartitioner; migrating schema to a cluster with a non-Murmur partitioner; tests with custom partitioners.","solutions":["Use Murmur3Partitioner (the default) for the table/cluster and recreate data if needed","Fall back to a legacy secondary index (CassandraIndex) instead of SAI on that cluster","Remove the SAI index definition from tables with unsupported partitioners"],"exampleFix":"// before\nCREATE TABLE data(key text PRIMARY KEY ...) WITH partitioner = 'ByteOrderedPartitioner';\nCREATE CUSTOM INDEX ... USING 'StorageAttachedIndex';\n// after\nCREATE TABLE data(key text PRIMARY KEY ...); // default Murmur3Partitioner\nCREATE CUSTOM INDEX ... USING 'StorageAttachedIndex';","handlingStrategy":"validation","validationCode":"if (ILLEGAL_PARTITIONERS.contains(metadata.partitioner.getClass())) throw new IllegalStateException(\"SAI unsupported partitioner: \" + metadata.partitioner.getClass());","typeGuard":null,"tryCatchPattern":"try { session.execute(createSaiIndex); } catch (InvalidRequestException e) { if (e.getMessage().contains(\"IPartitioner\")) { /* use legacy index or migrate partitioner */ } else throw e; }","preventionTips":["Use Murmur3Partitioner (default) for all new tables","Check cluster partitioner before adopting SAI","Never use ByteOrdered/Random partitioner for new deployments"],"tags":["cassandra","sai","partitioner","invalid-request"],"backgroundTag":"unsupported-operation","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"}