{"record":{"id":"1205687958abb389","repo":"prestodb/presto","slug":"lookup-is-not-supported","errorCode":null,"errorMessage":"lookup is not supported","messagePattern":"lookup is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftTpchService.java","lineNumber":207,"sourceCode":"            PrestoThriftNullableToken nextToken)\n    {\n        SplitInfo splitInfo = SPLIT_INFO_CODEC.fromJson(splitId.getId());\n        checkArgument(maxBytes >= DEFAULT_MAX_PAGE_SIZE_IN_BYTES, \"requested maxBytes is too small\");\n        ConnectorPageSource pageSource;\n        if (!splitInfo.isIndexSplit()) {\n            // normal scan\n            pageSource = createPageSource(splitInfo, outputColumns);\n        }\n        else {\n            // index lookup\n            pageSource = createLookupPageSource(splitInfo, outputColumns);\n        }\n        return getRowsInternal(pageSource, splitInfo.getTableName(), outputColumns, nextToken.getToken());\n    }\n\n    protected ConnectorPageSource createLookupPageSource(SplitInfo splitInfo, List<String> outputColumnNames)\n    {\n        throw new UnsupportedOperationException(\"lookup is not supported\");\n    }\n\n    @PreDestroy\n    @Override\n    public final void close()\n    {\n        executor.shutdownNow();\n    }\n\n    public static List<Type> types(String tableName, List<String> columnNames)\n    {\n        TpchTable<?> table = TpchTable.getTable(tableName);\n        return columnNames.stream().map(name -> getPrestoType(table.getColumn(name))).collect(toList());\n    }\n\n    public static double schemaNameToScaleFactor(String schemaName)\n    {\n        switch (schemaName) {","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftTpchService.java#L189-L225","documentation":"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.","triggerScenarios":"getRowsSync() receives a SplitInfo representing a lookup/index split while running on the base ThriftTpchService (or a subclass that did not override createLookupPageSource).","commonSituations":"A custom service subclass forgot to override createLookupPageSource; index splits generated elsewhere get fetched from the non-index service; misconfigured test server wiring.","solutions":["Override createLookupPageSource() in your ThriftTpchService subclass to return a real lookup page source","Route lookup splits to a service that supports them (e.g., ThriftIndexedTpchService)","Ensure split IDs are only sent back to the service that produced them","If lookups are not needed, prevent plans that generate lookup splits"],"exampleFix":"// before\nclass MyService extends ThriftTpchService { } // throws on lookup\n// after\nclass MyService extends ThriftTpchService {\n    @Override\n    protected ConnectorPageSource createLookupPageSource(SplitInfo splitInfo, List<String> outputColumnNames) {\n        return new MyLookupPageSource(splitInfo, outputColumnNames);\n    }\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean supportsLookup(ThriftTpchService service) {\n    return !(service.getClass() == ThriftTpchService.class);\n}","tryCatchPattern":null,"preventionTips":["Override createLookupPageSource in subclasses that generate lookup splits","Only send split IDs back to the service instance that created them","Keep lookup support and split generation in the same service class"],"tags":["thrift","testing","unsupported-operation","lookup"],"backgroundTag":"operation-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"}