{"record":{"id":"c556197d11f5f2dd","repo":"apache/beam","slug":"unable-to-get-value-from-field-name-schema-type-typename","errorCode":null,"errorMessage":"Unable to get value from field '{name}'. Schema type '{typeName}'. JSON node type {jsonNodeType}","messagePattern":"Unable to get value from field '(.+?)'\\. Schema type '(.+?)'\\. JSON node type (.+?)","errorType":"validation","errorClass":"UnsupportedRowJsonException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowJson.java","lineNumber":415,"sourceCode":"        Map.Entry<String, JsonNode> field = fields.next();\n        String key = field.getKey();\n        JsonNode value = field.getValue();\n\n        Object extractedValue =\n            extractJsonNodeValue(\n                FieldValue.of(\n                    mapFieldValue.name() + \"['\" + key + \"']\", mapFieldValue.mapValueType(), value));\n\n        result.put(key, extractedValue);\n      }\n      return result;\n    }\n\n    private static Object extractJsonPrimitiveValue(FieldValue fieldValue) {\n      try {\n        return JSON_VALUE_GETTERS.get(fieldValue.typeName()).extractValue(fieldValue.jsonValue());\n      } catch (RuntimeException e) {\n        throw new UnsupportedRowJsonException(\n            \"Unable to get value from field '\"\n                + fieldValue.name()\n                + \"'. Schema type '\"\n                + fieldValue.typeName()\n                + \"'. JSON node type \"\n                + fieldValue.jsonNodeType().name(),\n            e);\n      }\n    }\n\n    /**\n     * Helper class to keep track of schema field type, name, and actual json value for the field.\n     */\n    @AutoValue\n    abstract static class FieldValue {\n      abstract String name();\n\n      abstract FieldType type();","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowJson.java#L397-L433","documentation":"extractJsonPrimitiveValue looks up a per-type value getter by the field's schema type name and applies it to the Jackson node. Any RuntimeException from that getter (e.g. asking for TEXT and getting a number node, or numeric overflow, or bad logical-type formats) is rethrown as UnsupportedRowJsonException describing the schema type and JSON node type.","triggerScenarios":"jsonToRow where a leaf field's JSON value cannot be converted to the declared schema primitive/logical type, e.g. string node for INTEGER field, or invalid datetime string for a logical type.","commonSituations":"Type drift between producers and schema; locale/date formats not matching expected logical types; large numbers overflowing target types; unit-prefixed numbers passed as-is.","solutions":["Align JSON value types with the schema field types (string for TEXT, integer for INT64, etc.)","Fix logical-type formats (e.g. ISO-8601 datetimes) in the payload","Pre-convert/coerce values before jsonToRow","Catch UnsupportedRowJsonException; its message names the field, schema type, and JSON node type to pinpoint the mismatch"],"exampleFix":"// before: schema field INTEGER\n{\"count\": \"12\"}\n// after\n{\"count\": 12}","handlingStrategy":"validation","validationCode":"if (schemaField.getType().getTypeName() == Schema.TypeName.INT64 && node.isTextual()) {\n  json.put(schemaField.getName(), Long.parseLong(node.asText())); // coerce before parse\n}","typeGuard":null,"tryCatchPattern":"try { Row r = RowJsonUtils.jsonToRow(mapper, json); } catch (RowJson.UnsupportedRowJsonException e) { /* message names field, schema type, json node type */ }","preventionTips":["Enforce JSON value types matching schema primitives","Use ISO-8601 for datetime logical types","Add per-field type checks in an ingestion validator"],"tags":["beam","json","type-mismatch","deserialization"],"backgroundTag":"type-mismatch","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}