apache/cassandra · error · InvalidTypeException
Cannot parse UDT value from
Error message
Cannot parse UDT value from "%s", at character %d expecting ':' but got '%c'
What it means
InvalidTypeException from UDTCodec.parse: after a valid field name, the next non-space character is not the ':' separator between field name and value. The parser consumes the name then requires a colon; anything else (missing colon, wrong separator like '='), triggers this with the exact position and offending character.
Solutions
- Separate each field name and value with ':' as in {field: value}
- Fix the character at the reported position
- Avoid JSON-style formatting differences when pasting literals
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2689 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/4621d5f6d6dc28a2.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2689
}
catch (IllegalArgumentException e)
{
throw new InvalidTypeException(
String.format(
"Cannot parse UDT value from \"%s\", cannot parse a CQL identifier at character %d",
value, idx),
e);
}
String name = value.substring(idx, n);
idx = n;
if (!definition.contains(name))
throw new InvalidTypeException(
String.format("Unknown field %s in value \"%s\"", name, value));
idx = ParseUtils.skipSpaces(value, idx);
if (value.charAt(idx++) != ':')
throw new InvalidTypeException(
String.format(
"Cannot parse UDT value from \"%s\", at character %d expecting ':' but got '%c'",
value, idx, value.charAt(idx)));
idx = ParseUtils.skipSpaces(value, idx);
try
{
n = ParseUtils.skipCQLValue(value, idx);
}
catch (IllegalArgumentException e)
{
throw new InvalidTypeException(
String.format(
"Cannot parse UDT value from \"%s\", invalid CQL value at character %d",
value, idx),
e);
}
View on GitHub (pinned to 88fd0f6a0e)