{"record":{"id":"917c0cfc72f3d7d6","repo":"prestodb/presto","slug":"decoder-conversion-not-supported-917c0c","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/ISO8601JsonFieldDecoder.java","lineNumber":99,"sourceCode":"\n        public ISO8601JsonValueProvider(JsonNode value, DecoderColumnHandle columnHandle)\n        {\n            this.value = value;\n            this.columnHandle = columnHandle;\n        }\n\n        @Override\n        public boolean isNull()\n        {\n            return value.isMissingNode() || value.isNull();\n        }\n\n        @Override\n        public long getLong()\n        {\n            Type columnType = columnHandle.getType();\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'\", columnType, columnHandle.getName()));\n            }\n\n            try {\n                String textValue = value.asText();\n                if (columnType == TIMESTAMP) {\n                    // Equivalent to: ISO_DATE_TIME.parse(textValue, LocalDateTime::from).toInstant(UTC).toEpochMilli();\n                    TemporalAccessor parseResult = ISO_DATE_TIME.parse(textValue);\n                    return TimeUnit.DAYS.toMillis(parseResult.getLong(EPOCH_DAY)) + parseResult.getLong(MILLI_OF_DAY);\n                }\n                if (columnType == TIMESTAMP_WITH_TIME_ZONE) {\n                    // Equivalent to:\n                    // ZonedDateTime dateTime = ISO_OFFSET_DATE_TIME.parse(textValue, ZonedDateTime::from);\n                    // packDateTimeWithZone(dateTime.toInstant().toEpochMilli(), getTimeZoneKey(dateTime.getZone().getId()));\n                    TemporalAccessor parseResult = ISO_OFFSET_DATE_TIME.parse(textValue);\n                    return packDateTimeWithZone(parseResult.getLong(INSTANT_SECONDS) * 1000 + parseResult.getLong(MILLI_OF_SECOND), getTimeZoneKey(ZoneId.from(parseResult).getId()));\n                }","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-record-decoder/src/main/java/com/facebook/presto/decoder/json/ISO8601JsonFieldDecoder.java#L81-L117","documentation":"ISO8601JsonFieldDecoder.getLong parses ISO-8601 text into the column's timestamp type. If the mapped node is not a scalar value node (object/array), it throws PrestoException DECODER_CONVERSION_NOT_SUPPORTED saying the non-value node can't be parsed. The JSON shape doesn't match the expected ISO-8601 string field.","triggerScenarios":"An ISO8601-formatted timestamp/date column mapped to a JSON field that is an object or array rather than an ISO-8601 string.","commonSituations":"Producers wrap timestamps in objects like {\"date\":\"...\"}; misconfigured column mapping pointing at a nested structure; schema evolution on the topic.","solutions":["Inspect the JSON node at the mapped field","Fix the column mapping to point at the scalar ISO-8601 string field","Adjust producer to emit the timestamp as a top-level string","Remap or drop the column if the field is inherently structured"],"exampleFix":"// before\n{\"created\":{\"iso\":\"2024-01-01T00:00:00Z\"}} mapped to created timestamp\n// after\n{\"created\":\"2024-01-01T00:00:00Z\"} or map to created.iso","handlingStrategy":"validation","validationCode":"boolean ok = jsonNode.path(fieldName).isValueNode() && jsonNode.path(fieldName).isTextual();","typeGuard":"static boolean isTextField(JsonNode n) { return n != null && n.isValueNode() && n.isTextual(); }","tryCatchPattern":"try { long t = decoder.getLong(); } catch (PrestoException e) { if (DECODER_CONVERSION_NOT_SUPPORTED.equals(e.getErrorCode().getName())) { handleNonValueNode(); } else throw e; }","preventionTips":["Map temporal columns to scalar string fields, not nested objects","Keep ISO8601 columns pointing at top-level string properties","Add topic contract tests asserting field shapes"],"tags":["presto","decoder","json","iso8601"],"backgroundTag":"json-type-mismatch","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"}