prestodb/presto · error · UnsupportedOperationException
Type not supported:
Error message
Type not supported:
What it means
ScanQueryPageSource.createDecoder builds a decoder tree for each Presto column type when reading Elasticsearch documents. If a column's declared Type is not one of the handled types (bigint, integer, smallint, tinyint, double, float, boolean, varchar, timestamp, date, time, ip, array, row, map, json, varbinary), it throws UnsupportedOperationException. This happens when the external table schema declares a type the Elasticsearch connector has no decoder for.
Source
Thrown at presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ScanQueryPageSource.java:364
List<Decoder> decoders = rowType.getFields().stream()
.map(field -> createDecoder(session, appendPath(path, field.getName().get()), field.getType()))
.collect(toImmutableList());
List<String> fieldNames = rowType.getFields().stream()
.map(RowType.Field::getName)
.map(Optional::get)
.collect(toImmutableList());
return new RowDecoder(path, fieldNames, decoders);
}
else if (type instanceof ArrayType) {
Type elementType = ((ArrayType) type).getElementType();
return new ArrayDecoder(path, createDecoder(session, path, elementType));
}
throw new UnsupportedOperationException("Type not supported: " + type);
}
private static String appendPath(String base, String element)
{
if (base.isEmpty()) {
return element;
}
return base + "." + element;
}
private static class SearchHitIterator
extends AbstractIterator<Hit>
{
private final ElasticsearchClient client;
private final Supplier<SearchResponse> first;
private HitsMetadata searchHits;View on GitHub (pinned to 55bb57d202)
Solutions
- Change the column to a supported type (use VARCHAR or CAST to a supported type in the DDL).
- Upgrade or patch the Elasticsearch connector so it supports the needed type.
- Exclude or transform unsupported columns from the schema before querying.
Example fix
// before CREATE TABLE docs (payload MAP(VARCHAR, JSON)); // after (if map unsupported in your build) CREATE TABLE docs (payload VARCHAR); -- store JSON as text and parse with json_extract in the query
Defensive patterns
Strategy: validation
Validate before calling
-- before querying, confirm each column type is supported by the connector SHOW CREATE TABLE es.default.my_index; -- check types; only bigint/integer/smallint/tinyint/double/float/boolean/varchar/timestamp/date/time/ip/array/row/map/json/varbinary are decodable
Prevention
- Stick to documented, supported column types when creating tables over Elasticsearch.
- Test SHOW SELECT * on new tables before production queries.
- Keep the connector version aligned with the Presto distribution you run.
When it happens
Trigger: Creating a table with a column type the connector's decoder factory does not recognize (e.g. an exotic type or type mapping mismatch), then running a query that scans that column.
Common situations: Schema evolved across connector versions (type supported in docs but not in installed build); custom connectors wrapping Elasticsearch with unsupported types; DDL copied from other connectors (e.g. REAL, Decimal edge cases).
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/7468b2988176a749.
Report an issue: GitHub.