{"record":{"id":"89891448a879f781","repo":"prestodb/presto","slug":"decoder-conversion-not-supported-898914","errorCode":"DECODER_CONVERSION_NOT_SUPPORTED","errorMessage":"could not parse non-value node as '%s' for column '%s'","messagePattern":"could not parse non-value node as '(.+?)' for column '(.+?)'","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-record-decoder/src/main/java/com/facebook/presto/decoder/json/CustomDateTimeJsonFieldDecoder.java","lineNumber":94,"sourceCode":"        return new CustomDateTimeJsonValueProvider(value, columnHandle, formatter);\n    }\n\n    public static class CustomDateTimeJsonValueProvider\n            extends AbstractDateTimeJsonValueProvider\n    {\n        private final DateTimeFormatter formatter;\n\n        public CustomDateTimeJsonValueProvider(JsonNode value, DecoderColumnHandle columnHandle, DateTimeFormatter formatter)\n        {\n            super(value, columnHandle);\n            this.formatter = formatter;\n        }\n\n        @Override\n        protected long getMillis()\n        {\n            if (!value.isValueNode()) {\n                throw new PrestoException(\n                        DECODER_CONVERSION_NOT_SUPPORTED,\n                        format(\"could not parse non-value node as '%s' for column '%s'\", columnHandle.getType(), columnHandle.getName()));\n            }\n            try {\n                return formatter.parseMillis(value.asText());\n            }\n            catch (IllegalArgumentException e) {\n                throw new PrestoException(\n                        DECODER_CONVERSION_NOT_SUPPORTED,\n                        format(\"could not parse value '%s' as '%s' for column '%s'\", value.asText(), columnHandle.getType(), columnHandle.getName()));\n            }\n        }\n    }\n}\n","sourceCodeStart":76,"sourceCodeEnd":109,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-record-decoder/src/main/java/com/facebook/presto/decoder/json/CustomDateTimeJsonFieldDecoder.java#L76-L109","documentation":"CustomDateTimeJsonFieldDecoder.getMillis() first asserts the JSON node is a value node (scalar). If the node is an object or array, formatter.parseMillis could never succeed, so DECODER_CONVERSION_NOT_SUPPORTED is thrown with this message. The JSON field expected to hold a datetime string is instead a nested structure.","triggerScenarios":"JSON mapping path ($ or format-hinted path) resolves to an object like {\"date\": \"...\", \"tz\": \"...\"} or an array instead of a scalar string; upstream API changed the field from a string to a nested object.","commonSituations":"Source API schema evolution wrapping datetime strings in objects; wrong JSON path in the column mapping pointing at a parent node; mixed-type fields where some records carry objects.","solutions":["Fix the column mapping to point at the scalar leaf field holding the datetime string","Flatten or pre-transform nested JSON upstream so the datetime is a plain string value","Add defensive handling for records where the field is absent or nested","Verify the current source payload shape (it may have changed from the original mapping)"],"exampleFix":"// before\n{\"name\": \"created\", \"mapping\": \"$.created\"}  // {\"created\": {\"date\": \"2024-01-01\"}}\n// after\n{\"name\": \"created\", \"mapping\": \"$.created.date\"}","handlingStrategy":"type-guard","validationCode":"boolean isScalarAtPath(JsonNode root, String jsonPath) {\n    JsonNode n = root.at(jsonPath.replace(\"$.\", \"/\"));\n    return n != null && n.isValueNode();\n}","typeGuard":"boolean isDateTimeValueNode(JsonNode node) {\n    return node != null && node.isValueNode() && node.isTextual();\n}","tryCatchPattern":"try { row.getLong(columnName); }\ncatch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"DECODER_CONVERSION_NOT_SUPPORTED\")\n            && e.getMessage().contains(\"non-value node\")) {\n        log.warn(\"Field {} is nested/missing in payload\", columnName); return null;\n    }\n    throw e;\n}","preventionTips":["Point mappings at scalar leaf fields, not parent objects","Contract-test source API payload shape; alert on schema drift","Validate mappings against sampled live payloads"],"tags":["json","decoding","datetime","node-type"],"backgroundTag":"json-non-scalar-field","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}