{"record":{"id":"a244a99a63204eed","repo":"apache/cassandra","slug":"static-rows-are-not-supported-for-remote-table","errorCode":null,"errorMessage":"Static rows are not supported for remote table ","messagePattern":"Static rows are not supported for remote table ","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/RemoteToLocalVirtualTable.java","lineNumber":554,"sourceCode":"                }\n\n                DecoratedKey key = remoteClusteringToLocalPartitionKey(local, start, pkCount, pkBuffer);\n                builder = maybeRolloverAndWait(key, builder, results, endpoint);\n                if (start.size() == pkCount && end.size() == pkCount)\n                {\n                    builder.addPartitionDeletion(rt.deletionTime());\n                }\n                else\n                {\n                    start = ClusteringBound.create(start.kind(), Clustering.make(remoteClusteringToLocalClustering(start.clustering(), pkCount, ckBuffer)));\n                    end = ClusteringBound.create(end.kind(), Clustering.make(remoteClusteringToLocalClustering(end.clustering(), pkCount, ckBuffer)));\n                    builder.add(new RangeTombstone(Slice.make(start, end), rt.deletionTime()));\n                }\n            }\n        }\n\n        if (!update.staticRow().isEmpty())\n            throw new InvalidRequestException(\"Static rows are not supported for remote table \" + metadata);\n\n        try (BTree.FastBuilder<ColumnData> columns = BTree.fastBuilder())\n        {\n            for (Row row : update)\n            {\n                Clustering<?> clustering = row.clustering();\n                DecoratedKey key = remoteClusteringToLocalPartitionKey(local, clustering, pkCount, pkBuffer);\n                builder = maybeRolloverAndWait(key, builder, results, endpoint);\n                Clustering<?> newClustering = Clustering.make(remoteClusteringToLocalClustering(clustering, pkCount, ckBuffer));\n                columns.reset();\n                for (ColumnData cd : row)\n                    columns.add(rebind(local, cd));\n                builder.add(BTreeRow.create(newClustering, row.primaryKeyLivenessInfo(), row.deletion(), columns.build()));\n            }\n        }\n\n        if (builder != null)\n            results.add(send(Verb.VIRTUAL_MUTATION_REQ, new VirtualMutation(builder.build()), endpoint));","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/RemoteToLocalVirtualTable.java#L536-L572","documentation":"The underlying remote table has static columns, but the virtual table mapping cannot represent static rows (its schema folds remote clustering into partition keys). A write containing a non-empty static row is rejected with InvalidRequestException.","triggerScenarios":"INSERT/UPDATE (apply) on the virtual table where the PartitionUpdate contains a static row — e.g. the user sets a static column, or a batch/write path populates static columns of the underlying schema.","commonSituations":"Writes generated from base-table-shaped tooling that includes static column assignments; schema changes that added static columns after the virtual-table workflow was built.","solutions":["Do not set static columns when writing through the virtual table; write static columns via the underlying table on the owning node.","Remove static column assignments from the INSERT/UPDATE statement.","Consider dropping the static column from the underlying table if it is unused.","If static data must be updated remotely, use a direct CQL connection to the owning node's table."],"exampleFix":"// before\nINSERT INTO vt (pk, ck, static_col) VALUES (1, 'a', 'x');\n// after\nINSERT INTO vt (pk, ck) VALUES (1, 'a');  -- update static_col via base table instead","handlingStrategy":"validation","validationCode":"// Strip static column assignments before writing via the virtual table\nif (insertStatement.includesStaticColumns())\n    throw new IllegalArgumentException(\"Static columns not supported here; write via base table\");","typeGuard":null,"tryCatchPattern":"try { session.execute(write); }\ncatch (InvalidRequestException e) {\n    if (e.getMessage().contains(\"Static rows are not supported\"))\n        // remove static column assignments and retry\n}\n","preventionTips":["Exclude static columns from virtual-table writes","Update static data via the underlying table on the owning node","Watch schema changes that introduce static columns","Generate write statements from the virtual table schema, not the base table"],"tags":["cassandra","virtual-table","static-columns","unsupported-operation"],"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"}