prestodb/presto · error · IllegalArgumentException

Unhandled type:

Error message

Unhandled type: 

What it means

Value conversion default in the Elasticsearch query builder: the bound value's type matches none of the handled Presto types (numeric, varchar, timestamp...), so it cannot be turned into an Elasticsearch FieldValue for the term/range query.

Source

Thrown at presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchQueryBuilder.java:176

            return FieldValue.of(realValue);
        }

        if (type.equals(VARCHAR)) {
            String stringValue = ((Slice) value).toStringUtf8();
            return FieldValue.of(stringValue);
        }

        if (type.equals(TIMESTAMP)) {
            String dateValue = Instant.ofEpochMilli((Long) value)
                    .atZone(session.getSqlFunctionProperties().isLegacyTimestamp() ?
                            ZoneId.of(session.getSqlFunctionProperties().getTimeZoneKey().getId()) :
                            ZoneOffset.UTC)
                    .toLocalDateTime()
                    .format(ISO_DATE_TIME);

            return FieldValue.of(dateValue);
        }
        throw new IllegalArgumentException("Unhandled type: " + type);
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Cast the predicate column to a supported type in SQL
  2. Add a conversion branch for the missing type in the builder
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchQueryBuilder.java:176 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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