prestodb/presto · error · PrestoException

DECODER_CONVERSION_NOT_SUPPORTED

DECODER_CONVERSION_NOT_SUPPORTED

Error message

could not parse non-value node as '%s' for column '%s'

What it means

SecondsSinceEpochJsonFieldDecoder.getMillis multiplies the decoded second-precision value by 1000. If the mapped JsonNode is not a numeric node (int/long/biginteger) and is not even a value node (i.e. it is an object or array), the decoder cannot obtain a numeric value and throws PrestoException(DECODER_CONVERSION_NOT_SUPPORTED, "could not parse non-value node ..."). Numeric nodes that overflow or are non-numeric text instead surface via the companion catch-all error.

Source

Thrown at presto-record-decoder/src/main/java/com/facebook/presto/decoder/json/SecondsSinceEpochJsonFieldDecoder.java:81

            extends AbstractDateTimeJsonValueProvider
    {
        public SecondsSinceEpochJsonValueProvider(JsonNode value, DecoderColumnHandle columnHandle)
        {
            super(value, columnHandle);
        }

        @Override
        protected long getMillis()
        {
            try {
                if (value.isIntegralNumber()
                        && !value.isBigInteger()) {
                    return multiplyExact(value.longValue(), 1000);
                }
                if (value.isValueNode()) {
                    return multiplyExact(parseLong(value.asText()), 1000);
                }
                throw new PrestoException(
                        DECODER_CONVERSION_NOT_SUPPORTED,
                        format("could not parse non-value node as '%s' for column '%s'", columnHandle.getType(), columnHandle.getName()));
            }
            catch (NumberFormatException | ArithmeticException e) {
                throw new PrestoException(
                        DECODER_CONVERSION_NOT_SUPPORTED,
                        format("could not parse value '%s' as '%s' for column '%s'", value.asText(), columnHandle.getType(), columnHandle.getName()));
            }
        }
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Update the column mapping to the scalar field, e.g. mapping = 'time.sec'.
  2. Validate sample payloads against the table definition after any producer schema change.
  3. If compound time (seconds+nanos) is emitted, precompute a single seconds value upstream.
  4. Fall back to varchar decoding plus Presto JSON functions for irregular structures.

Example fix

// before
-- event_time ... data_format='seconds-since-epoch', mapping='time'
// after
-- event_time ... data_format='seconds-since-epoch', mapping='time.sec'
Defensive patterns

Strategy: validation

Validate before calling

JsonNode n = mapper.readTree(sampleJson).at("time.sec");
if (!n.isValueNode() || !(n.isNumber() || n.isTextual())) throw new IllegalStateException("seconds-since-epoch mapping must target a scalar numeric node");

Try / catch

try { runQuery(sql); } catch (SQLException e) { if (e.getMessage().contains("non-value node")) { log.error("Mapping points at container node; fix column mapping"); } else throw e; }

Prevention

When it happens

Trigger: Column with dataFormat 'seconds-since-epoch' whose mapping resolves to a JSON object or array, e.g. payload '{"time": {"sec": 1700000000}}' mapped as 'time'; the isValueNode() check fails and the exception is thrown before any arithmetic.

Common situations: Producer nested or restructured the timestamp field; mapping points to a wrapper object; arrays used for compound time values (sec/nanos).

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/b5d060125bf3ee2c. Report an issue: GitHub.