prestodb/presto · error · UnsupportedOperationException

lookup is not supported

Error message

lookup is not supported

What it means

ThriftTpchService.createLookupPageSource() throws UnsupportedOperationException because the base TPCH testing service does not implement lookup (indexed) page sources. It exists as an extension hook for subclasses like ThriftIndexedTpchService. Any call on the base class means a lookup split was routed to a service that cannot serve it.

Source

Thrown at presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftTpchService.java:207

            PrestoThriftNullableToken nextToken)
    {
        SplitInfo splitInfo = SPLIT_INFO_CODEC.fromJson(splitId.getId());
        checkArgument(maxBytes >= DEFAULT_MAX_PAGE_SIZE_IN_BYTES, "requested maxBytes is too small");
        ConnectorPageSource pageSource;
        if (!splitInfo.isIndexSplit()) {
            // normal scan
            pageSource = createPageSource(splitInfo, outputColumns);
        }
        else {
            // index lookup
            pageSource = createLookupPageSource(splitInfo, outputColumns);
        }
        return getRowsInternal(pageSource, splitInfo.getTableName(), outputColumns, nextToken.getToken());
    }

    protected ConnectorPageSource createLookupPageSource(SplitInfo splitInfo, List<String> outputColumnNames)
    {
        throw new UnsupportedOperationException("lookup is not supported");
    }

    @PreDestroy
    @Override
    public final void close()
    {
        executor.shutdownNow();
    }

    public static List<Type> types(String tableName, List<String> columnNames)
    {
        TpchTable<?> table = TpchTable.getTable(tableName);
        return columnNames.stream().map(name -> getPrestoType(table.getColumn(name))).collect(toList());
    }

    public static double schemaNameToScaleFactor(String schemaName)
    {
        switch (schemaName) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Override createLookupPageSource() in your ThriftTpchService subclass to return a real lookup page source
  2. Route lookup splits to a service that supports them (e.g., ThriftIndexedTpchService)
  3. Ensure split IDs are only sent back to the service that produced them
  4. If lookups are not needed, prevent plans that generate lookup splits

Example fix

// before
class MyService extends ThriftTpchService { } // throws on lookup
// after
class MyService extends ThriftTpchService {
    @Override
    protected ConnectorPageSource createLookupPageSource(SplitInfo splitInfo, List<String> outputColumnNames) {
        return new MyLookupPageSource(splitInfo, outputColumnNames);
    }
}
Defensive patterns

Strategy: type-guard

Type guard

boolean supportsLookup(ThriftTpchService service) {
    return !(service.getClass() == ThriftTpchService.class);
}

Prevention

When it happens

Trigger: getRowsSync() receives a SplitInfo representing a lookup/index split while running on the base ThriftTpchService (or a subclass that did not override createLookupPageSource).

Common situations: A custom service subclass forgot to override createLookupPageSource; index splits generated elsewhere get fetched from the non-index service; misconfigured test server wiring.

Related errors


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