prestodb/presto · error · PrestoThriftServiceException

Index join is not supported

Error message

Index join is not supported

What it means

ThriftTpchService.getIndexSplitsSync() unconditionally throws PrestoThriftServiceException("Index join is not supported", false) because the generic TPCH testing service does not implement index-join lookups. The 'false' retryable flag tells the coordinator the failure is permanent. Index joins are only provided by specialized services like ThriftIndexedTpchService.

Source

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

            List<String> indexColumnNames,
            List<String> outputColumnNames,
            PrestoThriftPageResult keys,
            PrestoThriftTupleDomain outputConstraint,
            int maxSplitCount,
            PrestoThriftNullableToken nextToken)
    {
        return executor.submit(() -> getIndexSplitsSync(schemaTableName, indexColumnNames, keys, maxSplitCount, nextToken));
    }

    protected PrestoThriftSplitBatch getIndexSplitsSync(
            PrestoThriftSchemaTableName schemaTableName,
            List<String> indexColumnNames,
            PrestoThriftPageResult keys,
            int maxSplitCount,
            PrestoThriftNullableToken nextToken)
            throws PrestoThriftServiceException
    {
        throw new PrestoThriftServiceException("Index join is not supported", false);
    }

    @Override
    public final ListenableFuture<PrestoThriftPageResult> getRows(
            PrestoThriftId splitId,
            List<String> outputColumns,
            long maxBytes,
            PrestoThriftNullableToken nextToken)
    {
        return executor.submit(() -> getRowsSync(splitId, outputColumns, maxBytes, nextToken));
    }

    private PrestoThriftPageResult getRowsSync(
            PrestoThriftId splitId,
            List<String> outputColumns,
            long maxBytes,
            PrestoThriftNullableToken nextToken)
    {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use/configure ThriftIndexedTpchService instead of the base ThriftTpchService for index-join workloads
  2. Rewrite the query to avoid index join (plain join/hash join)
  3. Upgrade/extend the service to implement getIndexSplitsSync if index lookup is needed
  4. Treat the non-retryable PrestoThriftServiceException as a configuration error and fail fast

Example fix

// before
PrestoThriftService service = new ThriftTpchService();
// after
PrestoThriftService service = new ThriftIndexedTpchService(); // supports index joins
Defensive patterns

Strategy: fallback

Validate before calling

// ensure index-join capable service is wired before running indexed queries
if (!(service instanceof ThriftIndexedTpchService)) {
    // avoid plans requiring getIndexSplits
}

Try / catch

try {
    List<PrestoThriftSplit> splits = service.getIndexSplits(...);
} catch (PrestoThriftServiceException e) {
    if (!e.isRetryable()) {
        throw new IllegalStateException("service does not support index join; use ThriftIndexedTpchService", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: The planner chooses an index join whose lookup source is a table served by a plain ThriftTpchService instance, causing getIndexSplits to be invoked.

Common situations: Tests or deployments wiring the non-index TPCH service where the query plan performs an index (keyed) lookup; forgetting to configure ThriftIndexedTpchService for index-join benchmarks.

Related errors


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