{"record":{"id":"b83ca819193fe395","repo":"apache/cassandra","slug":"s-does-not-support-complex-column-updates","errorCode":null,"errorMessage":"%s does not support complex column updates","messagePattern":"(.+?) does not support complex column updates","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/AbstractMutableLazyVirtualTable.java","lineNumber":102,"sourceCode":"    }\n\n    private void applyRow(Object[] pks, Row row)\n    {\n        Object[] cks = row.clustering().kind() == STATIC_CLUSTERING ? null : composeClusterings(row.clustering(), metadata());\n        if (!row.deletion().isLive())\n        {\n            applyRowDeletion(pks, cks);\n        }\n        else\n        {\n            ColumnMetadata[] columns = new ColumnMetadata[row.columnCount()];\n            Object[] values = new Object[row.columnCount()];\n            int i = 0;\n            for (ColumnData cd : row)\n            {\n                ColumnMetadata cm = cd.column();\n                if (cm.isComplex())\n                    throw new InvalidRequestException(metadata() + \" does not support complex column updates\");\n                Cell cell = (Cell)cd;\n                columns[i] = cm;\n                if (!cell.isTombstone())\n                    values[i] = cm.type.compose(cell.value(), cell.accessor());\n                ++i;\n            }\n            Invariants.require(i == columns.length);\n            applyRowUpdate(pks, cks, columns, values);\n        }\n    }\n\n    public void apply(PartitionUpdate update)\n    {\n        TableMetadata metadata = metadata();\n        Object[] pks = composePartitionKeys(update.partitionKey(), metadata);\n\n        DeletionInfo deletionInfo = update.deletionInfo();\n        if (!deletionInfo.getPartitionDeletion().isLive())","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AbstractMutableLazyVirtualTable.java#L84-L120","documentation":"AbstractMutableLazyVirtualTable.applyRow converts a row mutation into (columns, values) pairs fed to the backing map, but it only supports simple (non-collection, non-complex) cells. Multi-element cells (lists, sets, maps, UDTs) arrive as ComplexColumnData and cannot be represented, so InvalidRequestException is thrown.","triggerScenarios":"UPDATE/INSERT against a mutable virtual table setting a collection or UDT column, e.g. `UPDATE system.auth_roles SET options = {'x':1} ...` where the target virtual table defines a complex column or the statement writes one.","commonSituations":"Generic DML generators emitting collection writes; schema evolution adding collection columns to what used to be simple columns; users assuming virtual tables support the full CQL type system.","solutions":["Write only simple (non-collection) columns on mutable virtual tables","Replace collection writes with multiple statements updating individual simple columns, if the table exposes them","Check the virtual table's schema (DESCRIBE) and avoid complex columns entirely"],"exampleFix":"// before\nUPDATE system_auth.something SET tags = ['a','b'] WHERE key = 'k';\n// after\nUPDATE system_auth.something SET tag_a = 'a', tag_b = 'b' WHERE key = 'k';","handlingStrategy":"validation","validationCode":"for (ColumnMetadata cm : update.columns()) if (cm.isComplex()) throw new IllegalArgumentException(\"complex column \" + cm + \" unsupported on virtual table\");","typeGuard":null,"tryCatchPattern":"try { session.execute(updateStmt); } catch (InvalidRequestException e) { if (e.getMessage().contains(\"complex column updates\")) rewriteWithSimpleColumns(); else throw e; }","preventionTips":["Only write simple columns on mutable virtual tables","Validate statements against the virtual table schema before executing","Avoid schema changes introducing collections to virtual tables"],"tags":["cql","virtual-table","collections","mutation","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"}