{"record":{"id":"dc2564054e36272a","repo":"apache/cassandra","slug":"full-non-sai-indexes-can-only-be-created-on-froz","errorCode":null,"errorMessage":"full() non-SAI indexes can only be created on frozen collections","messagePattern":"full\\(\\) non-SAI indexes can only be created on frozen collections","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java","lineNumber":292,"sourceCode":"                throw  ire(UDTS_WITH_DURATIONS_NOT_SUPPORTED);\n\n            throw ire(DURATIONS_NOT_SUPPORTED);\n        }\n\n        if (table.isCompactTable())\n        {\n            TableMetadata.CompactTableMetadata compactTable = (TableMetadata.CompactTableMetadata) table;\n            if (column.isPrimaryKeyColumn())\n                throw new InvalidRequestException(PRIMARY_KEY_IN_COMPACT_STORAGE);\n            if (compactTable.compactValueColumn.equals(column))\n                throw new InvalidRequestException(COMPACT_COLUMN_IN_COMPACT_STORAGE);\n        }\n\n        if (column.isPartitionKey() && table.partitionKeyColumns().size() == 1)\n            throw ire(ONLY_PARTITION_KEY, column);\n\n        if (target.type == Type.FULL && isNonSAIIndex && (!baseType.isCollection() || column.type.isMultiCell()))\n            throw ire(FULL_ON_FROZEN_COLLECTIONS);\n\n        if (!baseType.isCollection() && target.type != Type.SIMPLE)\n            throw ire(NON_COLLECTION_SIMPLE_INDEX, target.type, column);\n\n        // Frozen collections are only supported with SAI indexes.\n        if (isNonSAIIndex && baseType.isCollection() && !column.type.isMultiCell())\n        {\n            if (target.type == Type.VALUES || target.type == Type.KEYS || target.type == Type.KEYS_AND_VALUES)\n            {\n                throw ire(CREATE_ON_FROZEN_COLUMN, target.type.toString(), column.name, column.name);\n            }\n        }\n\n        if (!(baseType instanceof MapType) && (target.type == Type.KEYS || target.type == Type.KEYS_AND_VALUES ))\n            throw ire(CREATE_WITH_NON_MAP_TYPE, target.type, column);\n\n        // Can't query map[key]=value on clustering key columns, so ENTRIES index would be not queryable.\n        if (column.isClusteringColumn() && baseType instanceof MapType && !column.type.isMultiCell()","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java#L274-L310","documentation":"The full() index modifier is only meaningful for frozen collections, and for non-SAI index backends full() may only be used on frozen collections. Using full() on a non-collection column or on a multi-cell (non-frozen) collection with a legacy (non-SAI) index throws this error.","triggerScenarios":"`CREATE INDEX ON t (full(col))` where col is not a collection (e.g. an int or text column), or where col is a multi-cell (non-frozen) list/set/map, with a non-SAI index implementation (legacy SecondaryIndex, SASI, most CUSTOM backends).","commonSituations":"Copy-pasting full() from SAI examples onto legacy index DDL; applying full() to every column when adding indexes broadly; confusion between frozen and non-frozen collection declarations.","solutions":["Remove the full() modifier for non-collection columns: CREATE INDEX ON t (col).","For collections, declare the column frozen (frozen<list<int>>) if full-indexing is required, then use full(col).","Switch to SAI (Storage-Attached Indexing) if on a version that supports it, which handles frozen collections differently."],"exampleFix":"// before\nCREATE INDEX ON t (full(tags)); // tags: list<text> (multi-cell)\n// after\nALTER TABLE t ALTER tags TYPE frozen<list<text>>; -- or redefine table\nCREATE INDEX ON t (full(tags));","handlingStrategy":"validation","validationCode":"if (target.type === 'FULL' && !isSaiIndex && (!baseType.isCollection() || column.type.isMultiCell())) throw new Error('full() requires a frozen collection for non-SAI indexes');","typeGuard":"const fullAllowed = (t, sai) => sai || (t.isCollection() && !t.isMultiCell());","tryCatchPattern":"try { session.execute(ddl); } catch (e) { if (/can only be created on frozen collections/.test(e.message)) { /* drop full() or freeze the collection */ } else throw e; }","preventionTips":["Only wrap frozen collections in full()","Distinguish SAI vs legacy index syntax in your DDL templates"],"tags":["cassandra","cql","secondary-index","collections","frozen"],"backgroundTag":"invalid-argument-value","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"}