{"record":{"id":"7468b2988176a749","repo":"prestodb/presto","slug":"type-not-supported","errorCode":null,"errorMessage":"Type not supported: ","messagePattern":"Type not supported: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ScanQueryPageSource.java","lineNumber":364,"sourceCode":"\n            List<Decoder> decoders = rowType.getFields().stream()\n                    .map(field -> createDecoder(session, appendPath(path, field.getName().get()), field.getType()))\n                    .collect(toImmutableList());\n\n            List<String> fieldNames = rowType.getFields().stream()\n                    .map(RowType.Field::getName)\n                    .map(Optional::get)\n                    .collect(toImmutableList());\n\n            return new RowDecoder(path, fieldNames, decoders);\n        }\n        else if (type instanceof ArrayType) {\n            Type elementType = ((ArrayType) type).getElementType();\n\n            return new ArrayDecoder(path, createDecoder(session, path, elementType));\n        }\n\n        throw new UnsupportedOperationException(\"Type not supported: \" + type);\n    }\n\n    private static String appendPath(String base, String element)\n    {\n        if (base.isEmpty()) {\n            return element;\n        }\n\n        return base + \".\" + element;\n    }\n\n    private static class SearchHitIterator\n            extends AbstractIterator<Hit>\n    {\n        private final ElasticsearchClient client;\n        private final Supplier<SearchResponse> first;\n\n        private HitsMetadata searchHits;","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ScanQueryPageSource.java#L346-L382","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","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."],"exampleFix":"// before\nCREATE TABLE docs (payload MAP(VARCHAR, JSON));\n// after (if map unsupported in your build)\nCREATE TABLE docs (payload VARCHAR); -- store JSON as text and parse with json_extract in the query","handlingStrategy":"validation","validationCode":"-- before querying, confirm each column type is supported by the connector\nSHOW 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","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["elasticsearch","type-decoding","unsupported-type","schema"],"backgroundTag":"unsupported-column-type","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"}