{"record":{"id":"aa03dc1ea6e00000","repo":"apache/cassandra","slug":"cannot-parse-udt-value-from-s-at-character-d","errorCode":null,"errorMessage":"Cannot parse UDT value from \"%s\", at character %d expecting '{' but got '%c'","messagePattern":"Cannot parse UDT value from \"(.+?)\", at character (.+?) expecting '\\{' but got '%c'","errorType":"exception","errorClass":"InvalidTypeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java","lineNumber":2655,"sourceCode":"                sb.append(Metadata.quoteIfNecessary(field.getName()));\n                sb.append(':');\n                sb.append(formatField(value, Metadata.quoteIfNecessary(field.getName())));\n                i += 1;\n            }\n            sb.append('}');\n            return sb.toString();\n        }\n\n        @Override\n        public T parse(String value)\n        {\n            if (value == null || value.isEmpty() || value.equals(\"NULL\")) return null;\n\n            T v = newInstance();\n\n            int idx = ParseUtils.skipSpaces(value, 0);\n            if (value.charAt(idx++) != '{')\n                throw new InvalidTypeException(\n                String.format(\n                \"Cannot parse UDT value from \\\"%s\\\", at character %d expecting '{' but got '%c'\",\n                value, idx, value.charAt(idx)));\n\n            idx = ParseUtils.skipSpaces(value, idx);\n\n            if (value.charAt(idx) == '}') return v;\n\n            while (idx < value.length())\n            {\n\n                int n;\n                try\n                {\n                    n = ParseUtils.skipCQLId(value, idx);\n                }\n                catch (IllegalArgumentException e)\n                {","sourceCodeStart":2637,"sourceCodeEnd":2673,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java#L2637-L2673","documentation":"InvalidTypeException from UDTCodec.parse: the UDT literal does not start with '{' after leading spaces (or is otherwise not brace-delimited). It is the first syntax guard of the parser, checked immediately after the null/NULL/empty short-circuit.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2655 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wrap the UDT literal in braces: {field: value, ...}","Quote field names that contain special characters","Ensure no stray prefix (e.g. a copy-pasted alias) precedes the opening brace"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}