{"record":{"id":"9a64865a4089dcbd","repo":"prestodb/presto","slug":"index-join-is-not-supported","errorCode":null,"errorMessage":"Index join is not supported","messagePattern":"Index join is not supported","errorType":"exception","errorClass":"PrestoThriftServiceException","httpStatus":null,"severity":"error","filePath":"presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftTpchService.java","lineNumber":172,"sourceCode":"            List<String> indexColumnNames,\n            List<String> outputColumnNames,\n            PrestoThriftPageResult keys,\n            PrestoThriftTupleDomain outputConstraint,\n            int maxSplitCount,\n            PrestoThriftNullableToken nextToken)\n    {\n        return executor.submit(() -> getIndexSplitsSync(schemaTableName, indexColumnNames, keys, maxSplitCount, nextToken));\n    }\n\n    protected PrestoThriftSplitBatch getIndexSplitsSync(\n            PrestoThriftSchemaTableName schemaTableName,\n            List<String> indexColumnNames,\n            PrestoThriftPageResult keys,\n            int maxSplitCount,\n            PrestoThriftNullableToken nextToken)\n            throws PrestoThriftServiceException\n    {\n        throw new PrestoThriftServiceException(\"Index join is not supported\", false);\n    }\n\n    @Override\n    public final ListenableFuture<PrestoThriftPageResult> getRows(\n            PrestoThriftId splitId,\n            List<String> outputColumns,\n            long maxBytes,\n            PrestoThriftNullableToken nextToken)\n    {\n        return executor.submit(() -> getRowsSync(splitId, outputColumns, maxBytes, nextToken));\n    }\n\n    private PrestoThriftPageResult getRowsSync(\n            PrestoThriftId splitId,\n            List<String> outputColumns,\n            long maxBytes,\n            PrestoThriftNullableToken nextToken)\n    {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftTpchService.java#L154-L190","documentation":"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.","triggerScenarios":"The planner chooses an index join whose lookup source is a table served by a plain ThriftTpchService instance, causing getIndexSplits to be invoked.","commonSituations":"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.","solutions":["Use/configure ThriftIndexedTpchService instead of the base ThriftTpchService for index-join workloads","Rewrite the query to avoid index join (plain join/hash join)","Upgrade/extend the service to implement getIndexSplitsSync if index lookup is needed","Treat the non-retryable PrestoThriftServiceException as a configuration error and fail fast"],"exampleFix":"// before\nPrestoThriftService service = new ThriftTpchService();\n// after\nPrestoThriftService service = new ThriftIndexedTpchService(); // supports index joins","handlingStrategy":"fallback","validationCode":"// ensure index-join capable service is wired before running indexed queries\nif (!(service instanceof ThriftIndexedTpchService)) {\n    // avoid plans requiring getIndexSplits\n}","typeGuard":null,"tryCatchPattern":"try {\n    List<PrestoThriftSplit> splits = service.getIndexSplits(...);\n} catch (PrestoThriftServiceException e) {\n    if (!e.isRetryable()) {\n        throw new IllegalStateException(\"service does not support index join; use ThriftIndexedTpchService\", e);\n    }\n    throw e;\n}","preventionTips":["Use ThriftIndexedTpchService for index-join benchmarks","Do not route lookup splits to plain ThriftTpchService instances","Assert service type in test setup before issuing indexed queries"],"tags":["thrift","testing","index-join","unsupported-operation"],"backgroundTag":"index-join-not-supported","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"}