apache/cassandra · error · InvalidRequestException
Argument ' ' cannot be frozen; remove frozen<> modifier from
Error message
Argument '%s' cannot be frozen; remove frozen<> modifier from '%s'
What it means
UDA argument types must be non-frozen. apply() rejects a DROP AGGREGATE whose declared argument types use the frozen<> modifier, asking the user to drop the qualifier since frozen and non-frozen types are matched equivalently for function arguments.
Solutions
- Remove frozen<> from each argument type in the DROP statement: use list<int>, map<k,v>, set<T> directly
- Match the signature exactly as shown by DESCRIBE AGGREGATE or system_schema.aggregates argument_types
Example fix
// before DROP AGGREGATE sales.agg (frozen<map<text,int>>); // after DROP AGGREGATE sales.agg (map<text,int>);
Defensive patterns
Strategy: validation
Validate before calling
const bad = types.find(t => /^frozen<.*>$/i.test(t.trim())); if (bad) throw new Error(`Remove frozen<> from argument '${bad}'`); Try / catch
try { session.execute(ddl); } catch (e) { if (e instanceof InvalidQueryError && /cannot be frozen/.test(e.message)) { /* strip frozen<> and retry */ } else throw e; } Prevention
- Never copy frozen<> from table column definitions into function/aggregate signatures
- Match signatures exactly to system_schema.aggregates argument_types
When it happens
Trigger: DROP AGGREGATE agg (frozen<list<int>>) or similar, where the aggregate was declared with non-frozen (or implicitly frozen) collection types.
Common situations: Copy-pasting the type expression from CREATE TABLE column definitions, where frozen<> is common; misunderstanding that function signatures don't take frozen<>.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Aggregate ' ' doesn't exist
- 'DROP AGGREGATE ' matches multiple function definitions…
- Cannot alter user type
- Frozen UDT column does not support field deletions
- Function ' ' is still referenced by aggregates
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/089f6975a49cba51.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:108
return schema;
throw ire("Aggregate '%s' doesn't exist", name);
}
Collection<UserFunction> aggregates = keyspace.userFunctions.get(new FunctionName(keyspaceName, aggregateName));
if (aggregates.size() > 1 && !argumentsSpeficied)
{
throw ire("'DROP AGGREGATE %s' matches multiple function definitions; " +
"specify the argument types by issuing a statement like " +
"'DROP AGGREGATE %s (type, type, ...)'. You can use cqlsh " +
"'DESCRIBE AGGREGATE %s' command to find all overloads",
aggregateName, aggregateName, aggregateName);
}
arguments.stream()
.filter(raw -> !raw.isImplicitlyFrozen() && raw.isFrozen())
.findFirst()
.ifPresent(t -> { throw ire("Argument '%s' cannot be frozen; remove frozen<> modifier from '%s'", t, t); });
List<AbstractType<?>> argumentTypes = prepareArgumentTypes(keyspace.types);
Predicate<UserFunction> filter = UserFunctions.Filter.UDA;
if (argumentsSpeficied)
filter = filter.and(f -> f.typesMatch(argumentTypes));
UserFunction aggregate = aggregates.stream().filter(filter).findAny().orElse(null);
if (null == aggregate)
{
if (ifExists)
return schema;
throw ire("Aggregate '%s' doesn't exist", name);
}
return schema.withAddedOrUpdated(keyspace.withSwapped(keyspace.userFunctions.without(aggregate)));
}View on GitHub (pinned to 88fd0f6a0e)