apache/cassandra · error · InvalidTypeException

Unknown field in value

Error message

Unknown field %s in value "%s"

What it means

InvalidTypeException from UDTCodec.parse: the field name just parsed is not one of the fields defined in the UDT (definition.contains(name) is false). The literal's structure is fine; it simply references a field the target type does not declare.

Solutions

  1. Check the UDT definition (DESCRIBE TYPE) and use exact field names
  2. Add the missing field to the UDT with ALTER TYPE if it is genuinely needed
  3. Remove stale fields from the literal after a type evolution dropped them
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2684 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/de82ed471cf402cf. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2684

                int n;
                try
                {
                    n = ParseUtils.skipCQLId(value, idx);
                }
                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(

View on GitHub (pinned to 88fd0f6a0e)