{"record":{"id":"ee388f70ba0a481b","repo":"apache/flink","slug":"fail-to-deserialize-at-field-s-ee388f","errorCode":null,"errorMessage":"Fail to deserialize at field: %s.","messagePattern":"Fail to deserialize at field: (.+?)\\.","errorType":"exception","errorClass":"org.apache.flink.formats.json.JsonParseException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonParserToRowDataConverters.java","lineNumber":426,"sourceCode":"            }\n            int arity = nameIdxMap.size();\n            GenericRowData row = new GenericRowData(arity);\n            int cnt = 0;\n            jp.nextToken();\n            while (jp.currentToken() != JsonToken.END_OBJECT) {\n                if (cnt >= arity) {\n                    skipToNextField(jp);\n                    continue;\n                }\n                String fieldName = jp.getText();\n                jp.nextToken();\n                Integer idx = nameIdxMap.get(fieldName);\n                if (idx != null) {\n                    try {\n                        Object convertField = fieldConverters[idx].convert(jp);\n                        row.setField(idx, convertField);\n                    } catch (Throwable t) {\n                        throw new JsonParseException(\n                                String.format(\"Fail to deserialize at field: %s.\", fieldName));\n                    }\n                    jp.nextToken();\n                    cnt++;\n                } else {\n                    skipToNextField(jp);\n                }\n            }\n            if (cnt < arity && failOnMissingField) {\n                throw new JsonParseException(\"Some field is missing in the JSON data.\");\n            }\n            return row;\n        };\n    }\n\n    public static void skipToNextField(JsonParser jp) throws IOException {\n        switch (jp.currentToken()) {\n            case START_OBJECT:","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonParserToRowDataConverters.java#L408-L444","documentation":"JsonParseException thrown per-field by createRowConverter when a named field's conversion throws any Throwable. Note the cause is deliberately not attached — only the field name is reported — so you must reproduce/inspect the payload to learn the underlying reason (type mismatch, number format, etc.). It fires before ignoreParseErrors is consulted at the outer layer, which then either wraps it as 'Failed to deserialize JSON' or skips the row.","triggerScenarios":"A field's JSON value cannot convert to its declared type: string 'abc' into INT, out-of-range numbers, wrong nested shape (errors 1371-1375 surface here as field failures when nested inside a row).","commonSituations":"Schema drift (producer adds/changes field types); locale-dependent number formats in strings; nulls in non-nullable positions handled by a later layer; timestamps in an unexpected format vs the configured timestamp-format.","solutions":["Look at the field named in the message and the raw record from the outer 'Failed to deserialize JSON' wrapper (or DEBUG logs with ignore-parse-errors) to identify the value","Adjust that column's DDL type or the 'timestamp-format' option to match reality","Fix the producer data; or set 'json.ignore-parse-errors'='true' to skip bad rows"],"exampleFix":"-- before: data contains \"amount\": \"1,024.50\"\namount DECIMAL(10,2)\n\n-- after: normalize at producer, or ingest as string and clean downstream\namount STRING","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (IOException wrapped) { // outer 'Failed to deserialize JSON'\n    Throwable cause = wrapped.getCause(); // JsonParseException 'Fail to deserialize at field: X'\n    String field = extractFieldName(cause.getMessage());\n    deadLetter(record, field);\n}","preventionTips":["Note the field error swallows its cause; keep the raw record for reproduction","Contract-test field types between producer and DDL in CI","Choose the right 'timestamp-format' up front to avoid timestamp field failures"],"tags":["flink","json","field-conversion","schema-drift","data-quality"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}