apache/cassandra · error · InvalidTypeException

Malformed UDT value " ", missing closing '}

Error message

Malformed UDT value "%s", missing closing '}'

What it means

InvalidTypeException from UDTCodec.parse: parsing consumed the input (or hit a non-separator) without finding the closing '}' of the UDT literal — the loop over fields ended with input remaining but no brace, i.e. the literal is unterminated or truncated.

Solutions

  1. Append the closing '}' to complete the UDT literal
  2. Re-check that nested braces are balanced
  3. Re-copy the full literal if it was truncated in transit
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2723 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/a4c4625749334cdc. Report an issue: GitHub.

Appendix: source

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

                    e);
                }

                String input = value.substring(idx, n);
                v = parseAndSetField(input, v, name);
                idx = n;

                idx = ParseUtils.skipSpaces(value, idx);
                if (value.charAt(idx) == '}') return v;
                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; // skip ','

                idx = ParseUtils.skipSpaces(value, idx);
            }
            throw new InvalidTypeException(
            String.format("Malformed UDT value \"%s\", missing closing '}'", value));
        }

        /**
         * Return a new instance of {@code T}.
         *
         * @return A new instance of {@code T}.
         */
        protected abstract T newInstance();

        /**
         * Serialize an individual field in an object, as part of serializing the whole object to a CQL
         * UDT (see {@link #serialize(Object, ProtocolVersion)}).
         *
         * @param source          The object to read the field from.
         * @param fieldName       The name of the field. Note that if it is case-sensitive or contains special
         *                        characters, it will be double-quoted (i.e. the string will contain actual quote
         *                        characters, as in {@code "\"foobar\""}).

View on GitHub (pinned to 88fd0f6a0e)