{"record":{"id":"efe35b5dd8e60106","repo":"prestodb/presto","slug":"schema-is-not-setup","errorCode":null,"errorMessage":"Schema is not setup: ","messagePattern":"Schema is not setup: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftTpchService.java","lineNumber":231,"sourceCode":"    {\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) {\n            case \"tiny\":\n                return 0.01;\n            case \"sf1\":\n                return 1.0;\n        }\n        throw new IllegalArgumentException(\"Schema is not setup: \" + schemaName);\n    }\n\n    private static PrestoThriftPageResult getRowsInternal(ConnectorPageSource pageSource, String tableName, List<String> columnNames, @Nullable PrestoThriftId nextToken)\n    {\n        // very inefficient implementation as it needs to re-generate all previous results to get the next page\n        int skipPages = nextToken != null ? Ints.fromByteArray(nextToken.getId()) : 0;\n        skipPages(pageSource, skipPages);\n\n        Page page = null;\n        while (!pageSource.isFinished() && page == null) {\n            page = pageSource.getNextPage();\n            skipPages++;\n        }\n        PrestoThriftId newNextToken = pageSource.isFinished() ? null : new PrestoThriftId(Ints.toByteArray(skipPages));\n\n        return toThriftPage(page, types(tableName, columnNames), newNextToken);\n    }\n","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftTpchService.java#L213-L249","documentation":"ThriftTpchService.schemaNameToScaleFactor() maps TPCH schema names to scale factors, accepting only \"tiny\" (0.01) and \"sf1\" (1.0). Any other catalog schema name throws IllegalArgumentException(\"Schema is not setup: <name>\"). The in-memory testing server only materializes these two schemas.","triggerScenarios":"Connecting to the thrift testing server with a catalog schema other than \"tiny\" or \"sf1\", then running a query that triggers createPageSource -> schemaNameToScaleFactor.","commonSituations":"Tests pointing at sf10/sf100 or custom schema names; a catalog renamed; environment configs assuming all TPCH scale factors exist on the test server.","solutions":["Use schema \"tiny\" or \"sf1\" when querying the thrift testing server","Add the desired schema name and scale factor to the switch in schemaNameToScaleFactor()","Fix the catalog/schema configuration on the client side to match a supported name"],"exampleFix":"// before\nString schema = \"sf100\"; // IllegalArgumentException\n// after\nString schema = \"sf1\"; // supported by ThriftTpchService","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"tiny\", \"sf1\");\nif (!supported.contains(schemaName)) {\n    throw new IllegalArgumentException(\"schema not available on thrift test server: \" + schemaName);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only connect test clients with schema 'tiny' or 'sf1'","Document supported schemas alongside the thrift testing server","Add new scale factors in schemaNameToScaleFactor before advertising them"],"tags":["thrift","testing","configuration","tpch"],"backgroundTag":"schema-not-configured","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"}