{"record":{"id":"589aa2ae2fdd0706","repo":"prestodb/presto","slug":"decoder-conversion-not-supported-589aa2","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/DefaultJsonFieldDecoder.java","lineNumber":131,"sourceCode":"            this.value = value;\n            this.columnHandle = columnHandle;\n            this.minValue = minValue;\n            this.maxValue = maxValue;\n        }\n\n        @Override\n        public final boolean isNull()\n        {\n            return value.isMissingNode() || value.isNull();\n        }\n\n        @Override\n        public boolean getBoolean()\n        {\n            if (value.isValueNode()) {\n                return value.asBoolean();\n            }\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\n        @Override\n        public long getLong()\n        {\n            try {\n                long longValue;\n                if (value.isIntegralNumber() && !value.isBigInteger()) {\n                    longValue = value.longValue();\n                    if (longValue >= minValue && longValue <= maxValue) {\n                        return longValue;\n                    }\n                }\n                else if (value.isValueNode()) {\n                    longValue = parseLong(value.asText());\n                    if (longValue >= minValue && longValue <= maxValue) {","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-record-decoder/src/main/java/com/facebook/presto/decoder/json/DefaultJsonFieldDecoder.java#L113-L149","documentation":"DefaultJsonFieldDecoder.getBoolean only supports scalar JSON value nodes; it reads value.asBoolean(). If the mapped node is a container (object/array) or missing/non-value node, it throws PrestoException DECODER_CONVERSION_NOT_SUPPORTED. This means the JSON structure does not match the declared boolean column.","triggerScenarios":"A boolean column mapped to a JSON field whose node is an object or array (isValueNode() false), e.g. the field holds nested JSON instead of true/false.","commonSituations":"Misconfigured JSON path/column mapping pointing at a nested object; producers switched from boolean to object payloads; schema drift between topic and table definition.","solutions":["Inspect the raw JSON at the mapped field to confirm it is a scalar boolean","Fix the column mapping (mapping/dataFormat) to point at a boolean-valued field","Adjust producer schema to emit a boolean for this field","Remove or retype the column if the field legitimately holds complex JSON"],"exampleFix":"// before (row)\n{\"flag\":{\"value\":true}} mapped to column flag:boolean\n// after\n{\"flag\":true} or remap the column to flag.value","handlingStrategy":"validation","validationCode":"boolean ok = jsonNode.path(fieldName).isBoolean();","typeGuard":"static boolean isBooleanField(JsonNode n) { return n != null && n.isValueNode() && n.isBoolean(); }","tryCatchPattern":"try { boolean b = decoder.getBoolean(); } catch (PrestoException e) { if (e.getErrorCode().getName().equals(\"DECODER_CONVERSION_NOT_SUPPORTED\")) { handleBadRow(); } else throw e; }","preventionTips":["Keep topic schema primitive and flat for decoded columns","Verify mapping paths point at scalar fields","Alert on non-value nodes via a JSON schema validator at ingest"],"tags":["presto","decoder","json","type-mismatch"],"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"}