{"record":{"id":"c4fdedf6f91a0b10","repo":"apache/cassandra","slug":"argument-s-cannot-be-frozen-remove-frozen-mo","errorCode":null,"errorMessage":"Argument '%s' cannot be frozen; remove frozen<> modifier from '%s'","messagePattern":"Argument '(.+?)' cannot be frozen; remove frozen<> modifier from '(.+?)'","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java","lineNumber":114,"sourceCode":"    @Override\n    public boolean compatibleWith(ClusterMetadata metadata)\n    {\n        return metadata.directory.commonSerializationVersion.isAtLeast(Version.V0);\n    }\n\n    @Override\n    public Keyspaces apply(ClusterMetadata metadata)\n    {\n        if (ifNotExists && orReplace)\n            throw ire(\"Cannot use both 'OR REPLACE' and 'IF NOT EXISTS' directives\");\n\n        if (!FunctionName.isNameValid(aggregateName))\n            throw ire(\"Aggregate name '%s' is invalid\", aggregateName);\n\n        rawArgumentTypes.stream()\n                        .filter(raw -> !raw.isImplicitlyFrozen() && raw.isFrozen())\n                        .findFirst()\n                        .ifPresent(t -> { throw ire(\"Argument '%s' cannot be frozen; remove frozen<> modifier from '%s'\", t, t); });\n\n        if (!rawStateType.isImplicitlyFrozen() && rawStateType.isFrozen())\n            throw ire(\"State type '%s' cannot be frozen; remove frozen<> modifier from '%s'\", rawStateType, rawStateType);\n\n        Keyspaces schema = metadata.schema.getKeyspaces();\n        KeyspaceMetadata keyspace = schema.getNullable(keyspaceName);\n        if (null == keyspace)\n            throw ire(\"Keyspace '%s' doesn't exist\", keyspaceName);\n\n        /*\n         * Resolve the state function\n         */\n\n        List<AbstractType<?>> argumentTypes =\n            rawArgumentTypes.stream()\n                            .map(t -> t.prepare(keyspaceName, keyspace.types).getType().udfType())\n                            .collect(toList());\n        AbstractType<?> stateType = rawStateType.prepare(keyspaceName, keyspace.types).getType().udfType();","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java#L96-L132","documentation":"CreateAggregateStatement.apply validation: one of the aggregate's argument types is declared frozen<>, which is meaningless/unsupported for function arguments; the frozen modifier must be removed from that argument type.","triggerScenarios":"Any rawArgumentTypes entry where raw.isFrozen() is true and isImplicitlyFrozen() is false, e.g. frozen<list<int>> written by the user in the aggregate signature.","commonSituations":"Copy-pasting frozen<> from table column definitions into aggregate signatures; misunderstanding when frozen<> is required.","solutions":["Remove the frozen<> modifier from the argument type in CREATE AGGREGATE","Use the plain collection/UDT type (e.g. list<int> instead of frozen<list<int>>)","Only use frozen<> where the schema genuinely requires it (table columns), not function args"],"exampleFix":"// before\nCREATE AGGREGATE ks.f(frozen<list<int>>) ...\n// after\nCREATE AGGREGATE ks.f(list<int>) ...","handlingStrategy":"validation","validationCode":"args.forEach(t -> { if (t.contains(\"frozen<\") && !isImplicitlyFrozen(t)) throw new IllegalArgumentException(\"Remove frozen<> from arg: \" + t); });","typeGuard":null,"tryCatchPattern":"try { session.execute(ddl); }\ncatch (InvalidRequestException e) { if (e.getMessage().contains(\"cannot be frozen\")) retryWithUnfrozenArgs(ddl); else throw e; }","preventionTips":["Never copy frozen<> modifiers from column definitions into function/aggregate signatures","Understand that frozen is a table-storage concept, not a function-signature concept","Lint generated DDL for frozen<> inside CREATE FUNCTION/AGGREGATE"],"tags":["cql","aggregate","udt","frozen","type-validation"],"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-17T15:17:12.973Z"}