{"record":{"id":"90ac8278b0c25f43","repo":"apache/cassandra","slug":"unsupported-collection-type","errorCode":null,"errorMessage":"Unsupported collection type: ","messagePattern":"Unsupported collection type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/accord/serializers/AccordSerializers.java","lineNumber":73,"sourceCode":"public class AccordSerializers\n{\n    public static <A, B> EmbeddedAsymmetricVersionedSerializer<A, B, Version> embedded(Version version, AsymmetricVersionedSerializer<A, B, Version> serializer)\n    {\n        return new EmbeddedAsymmetricVersionedSerializer<>(version, Version.Serializer.instance, serializer);\n    }\n\n    public static Term.Terminal deserializeCqlCollectionAsTerm(ByteBuffer buffer, AbstractType<?> type)\n    {\n        CollectionType<?> collectionType = (CollectionType<?>) type;\n\n        if (collectionType.kind == SET)\n            return MultiElements.Value.fromSerialized(buffer, (SetType<?>) type);\n        else if (collectionType.kind == LIST)\n            return MultiElements.Value.fromSerialized(buffer, (ListType<?>) type);\n        else if (collectionType.kind == MAP)\n            return MultiElements.Value.fromSerialized(buffer, (MapType<?, ?>) type);\n\n        throw new UnsupportedOperationException(\"Unsupported collection type: \" + type);\n    }\n\n    public static final ParameterisedUnversionedSerializer<ColumnMetadata, TableMetadata> columnMetadataSerializer = new ParameterisedUnversionedSerializer<>()\n    {\n        @Override\n        public void serialize(ColumnMetadata column, TableMetadata table, DataOutputPlus out) throws IOException\n        {\n            out.writeUnsignedVInt32(column.uniqueId);\n        }\n\n        @Override\n        public ColumnMetadata deserialize(TableMetadata table, DataInputPlus in) throws IOException\n        {\n            return table.getColumnById(in.readUnsignedVInt32());\n        }\n\n        @Override\n        public long serializedSize(ColumnMetadata column, TableMetadata table)","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/serializers/AccordSerializers.java#L55-L91","documentation":"AccordSerializers.deserializeCqlCollectionAsTerm deserializes CQL collection values (SET, LIST, MAP) into Accord term MultiElements.Value. If the column's AbstractType is a collection of another kind, it throws UnsupportedOperationException 'Unsupported collection type: ' + type. Only set/list/map collection kinds are supported.","triggerScenarios":"Deserializing an Accord-managed table column whose type reports a collection kind other than SET/LIST/MAP — e.g. a future/custom collection type or a misconfigured column type in a user table consumed by Accord serialization paths.","commonSituations":"Using exotic or custom column types in tables referenced by Accord-backed features; schema drift between nodes where one node sees a different type; forward-compatibility issues after a Cassandra upgrade introduces new collection kinds.","solutions":["Change the column to a supported collection type (set, list, or map) or a scalar/frozen type the serializers handle.","Ensure all nodes run a version whose AccordSerializers understands the column's type (align versions / restart with consistent schema).","Re-check the table schema (DESCRIBE TABLE) for the offending column and alter it accordingly."],"exampleFix":"// before\ncustom_tags tuple<int, text> -- non-supported collection-ish type\n// after\nALTER TABLE t DROP custom_tags;\nALTER TABLE t ADD custom_tags map<int, text>;","handlingStrategy":"validation","validationCode":"AbstractType<?> t = column.type;\nif (t.isCollection() && !t.isFrozen()) {\n    switch (((CollectionType<?>) t).kind) {\n        case SET: case LIST: case MAP: break;\n        default: throw new IllegalArgumentException(\"unsupported collection kind for \" + column.name);\n    }\n}","typeGuard":"boolean isSupportedCollection(AbstractType<?> t) { return !t.isCollection() || ((CollectionType<?>) t).kind == SET || ((CollectionType<?>) t).kind == LIST || ((CollectionType<?>) t).kind == MAP; }","tryCatchPattern":"try { deserialize(...); } catch (UnsupportedOperationException e) { LOG.error(\"Unsupported column type; use set/list/map: {}\", e.getMessage()); }","preventionTips":["Restrict Accord-managed table columns to standard set/list/map or scalar types.","Keep schema consistent across nodes; verify with schema agreement.","Re-verify types after Cassandra upgrades."],"tags":["accord","serialization","cql","types"],"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"}