prestodb/presto · error · PrestoException
NOT_SUPPORTED
NOT_SUPPORTED
Error message
Cannot operate on a t-digest with real numbers
What it means
The t-digest implementation only accepts DOUBLE input values. REAL (float) is explicitly rejected with NOT_SUPPORTED rather than silently upcast, because the underlying TDigest method handles are bound only for double.
Source
Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/StatisticalDigestAggregationFunction.java:204
switch (type) {
case TDIGEST:
return getTDigestInputMethodHandle(valueType, arity);
case QDIGEST:
return getQuantileDigestInputMethodHandle(valueType, arity);
default:
throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("%s must be a statistical digest", type));
}
}
private MethodHandle getTDigestInputMethodHandle(Type valueType, int arity)
{
final MethodHandle inputFunction;
switch (valueType.getDisplayName()) {
case StandardTypes.DOUBLE:
inputFunction = T_DIGEST_INPUT_DOUBLE;
break;
case StandardTypes.REAL:
throw new PrestoException(NOT_SUPPORTED, "Cannot operate on a t-digest with real numbers");
case StandardTypes.BIGINT:
throw new PrestoException(NOT_SUPPORTED, "Cannot operate on a t-digest with longs");
default:
throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Unsupported type %s supplied", valueType.getDisplayName()));
}
return addArguments(inputFunction, arity, DEFAULT_COMPRESSION);
}
private static MethodHandle getQuantileDigestInputMethodHandle(Type valueType, int arity)
{
final MethodHandle inputFunction;
switch (valueType.getDisplayName()) {
case StandardTypes.DOUBLE:
inputFunction = QUANTILE_DIGEST_INPUT_DOUBLE;
break;
case StandardTypes.REAL:
inputFunction = INPUT_REAL;
break;View on GitHub (pinned to 55bb57d202)
Solutions
- CAST the REAL column to DOUBLE before the t-digest aggregation.
- Use a q-digest/double aggregation variant that supports REAL if available.
- Change the schema to store DOUBLE if t-digest operations are the primary use.
Example fix
// before SELECT tdigest_agg(temperature) FROM sensors; -- temperature is REAL // after SELECT tdigest_agg(CAST(temperature AS DOUBLE)) FROM sensors;
Defensive patterns
Strategy: type-guard
Validate before calling
-- verify column type before t-digest SELECT typeof(temperature) FROM sensors LIMIT 1; -- must be double, not real
Type guard
boolean supportsTDigest(Type t) { return t.getDisplayName().equals("double"); } Try / catch
try { agg(); } catch (PrestoException e) { if (e.getErrorCode().getName().equals("NOT_SUPPORTED") && e.getMessage().contains("real")) { castToDoubleAndRetry(); } else throw e; } Prevention
- CAST REAL columns to DOUBLE for t-digest use
- Prefer DOUBLE column types in schemas used for quantiles
- Check function docs for supported input types
When it happens
Trigger: Creating a t-digest aggregation (tdigest_agg or similar) over a REAL column, which reaches getTDigestInputMethodHandle's REAL case.
Common situations: Using float4 columns (e.g. sensor readings) directly with t-digest quantile approximations.
Understand the failure class
Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.
Related errors
- NOT_SUPPORTED
- NOT_SUPPORTED
- BIGQUERY_UNSUPPORTED_COLUMN_TYPE
- NOT_SUPPORTED
- Unsupported Cassandra type: %s
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/99b96c0676e491fa.
Report an issue: GitHub.