{"record":{"id":"a4aaac62d7480d28","repo":"apache/cassandra","slug":"argument-s-cannot-be-frozen-remove-frozen-mo-a4aaac","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/DropFunctionStatement.java","lineNumber":110,"sourceCode":"                return schema;\n\n            throw ire(\"Function '%s' doesn't exist\", name);\n        }\n\n        Collection<UserFunction> functions = keyspace.userFunctions.get(new FunctionName(keyspaceName, functionName));\n        if (functions.size() > 1 && !argumentsSpeficied)\n        {\n            throw ire(\"'DROP FUNCTION %s' matches multiple function definitions; \" +\n                      \"specify the argument types by issuing a statement like \" +\n                      \"'DROP FUNCTION %s (type, type, ...)'. You can use cqlsh \" +\n                      \"'DESCRIBE FUNCTION %s' command to find all overloads\",\n                      functionName, functionName, functionName);\n        }\n\n        arguments.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        List<AbstractType<?>> argumentTypes = prepareArgumentTypes(keyspace.types);\n\n        Predicate<UserFunction> filter = UserFunctions.Filter.UDF;\n        if (argumentsSpeficied)\n            filter = filter.and(f -> f.typesMatch(argumentTypes));\n\n        UserFunction function = functions.stream().filter(filter).findAny().orElse(null);\n        if (null == function)\n        {\n            if (ifExists)\n                return schema;\n\n            throw ire(\"Function '%s' doesn't exist\", name);\n        }\n\n        String dependentAggregates =\n            keyspace.userFunctions","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java#L92-L128","documentation":"Thrown by DROP FUNCTION when one of the declared argument types uses the frozen<> modifier. Cassandra implicitly freezes UDT arguments in function signatures, so explicitly writing frozen<> is redundant and rejected to keep signatures canonical.","triggerScenarios":"Executing DROP FUNCTION whose target signature declares an argument as frozen<some_udt>; detected in apply() by filtering raw argument types with raw.isFrozen() && !raw.isImplicitlyFrozen().","commonSituations":"Copying a function signature from a frozen table column definition; older CQL examples predating implicit freezing of UDT arguments in function signatures.","solutions":["Remove the frozen<> modifier from the function argument type in the statement.","If the argument is a UDT, declare the bare UDT name and rely on implicit freezing.","Re-run the DROP FUNCTION statement with the corrected signature."],"exampleFix":"// before\nDROP FUNCTION ks.my_fn (frozen<address>);\n// after\nDROP FUNCTION ks.my_fn (address);","handlingStrategy":"validation","validationCode":"// reject before sending\nfor (String arg : args) if (arg.matches(\"frozen<.*>\")) throw new IllegalArgumentException(\"remove frozen<> from function argument: \" + arg);","typeGuard":"boolean isExplicitlyFrozen(AbstractType<?> t) { return t instanceof FrozenType; }","tryCatchPattern":"try { dropFunction(keyspace, args); } catch (InvalidRequestException e) { if (e.getMessage().contains(\"cannot be frozen\")) { /* rewrite signature without frozen<> */ } else throw e; }","preventionTips":["Never write frozen<> in function/procedure argument lists","Copy canonical signatures from DESCRIBE FUNCTION","Remember UDT function args are implicitly frozen"],"tags":["cql","schema","udf"],"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"}