prestodb/presto · error · IllegalArgumentException

Schema is not setup:

Error message

Schema is not setup: 

What it means

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.

Source

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

    {
        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) {
            case "tiny":
                return 0.01;
            case "sf1":
                return 1.0;
        }
        throw new IllegalArgumentException("Schema is not setup: " + schemaName);
    }

    private static PrestoThriftPageResult getRowsInternal(ConnectorPageSource pageSource, String tableName, List<String> columnNames, @Nullable PrestoThriftId nextToken)
    {
        // very inefficient implementation as it needs to re-generate all previous results to get the next page
        int skipPages = nextToken != null ? Ints.fromByteArray(nextToken.getId()) : 0;
        skipPages(pageSource, skipPages);

        Page page = null;
        while (!pageSource.isFinished() && page == null) {
            page = pageSource.getNextPage();
            skipPages++;
        }
        PrestoThriftId newNextToken = pageSource.isFinished() ? null : new PrestoThriftId(Ints.toByteArray(skipPages));

        return toThriftPage(page, types(tableName, columnNames), newNextToken);
    }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use schema "tiny" or "sf1" when querying the thrift testing server
  2. Add the desired schema name and scale factor to the switch in schemaNameToScaleFactor()
  3. Fix the catalog/schema configuration on the client side to match a supported name

Example fix

// before
String schema = "sf100"; // IllegalArgumentException
// after
String schema = "sf1"; // supported by ThriftTpchService
Defensive patterns

Strategy: validation

Validate before calling

Set<String> supported = Set.of("tiny", "sf1");
if (!supported.contains(schemaName)) {
    throw new IllegalArgumentException("schema not available on thrift test server: " + schemaName);
}

Prevention

When it happens

Trigger: Connecting to the thrift testing server with a catalog schema other than "tiny" or "sf1", then running a query that triggers createPageSource -> schemaNameToScaleFactor.

Common situations: Tests pointing at sf10/sf100 or custom schema names; a catalog renamed; environment configs assuming all TPCH scale factors exist on the test server.

Related errors


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