prestodb/presto · error · IllegalArgumentException

Table not setup:

Error message

Table not setup: 

What it means

ThriftTpchService.createPageSource(SplitInfo,...) dispatches on the split's table name and only knows nation, region, part, supplier, etc.; any other table hits the default branch and throws IllegalArgumentException("Table not setup: <name>"). The in-memory TPCH test service only serves the tables it explicitly wired.

Source

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

    private static ConnectorPageSource createPageSource(SplitInfo splitInfo, List<String> columnNames)
    {
        switch (splitInfo.getTableName()) {
            case "orders":
                return createPageSource(TpchTable.ORDERS, columnNames, splitInfo);
            case "customer":
                return createPageSource(TpchTable.CUSTOMER, columnNames, splitInfo);
            case "lineitem":
                return createPageSource(TpchTable.LINE_ITEM, columnNames, splitInfo);
            case "nation":
                return createPageSource(TpchTable.NATION, columnNames, splitInfo);
            case "region":
                return createPageSource(TpchTable.REGION, columnNames, splitInfo);
            case "part":
                return createPageSource(TpchTable.PART, columnNames, splitInfo);
            case "supplier":
                return createPageSource(TpchTable.SUPPLIER, columnNames, splitInfo);
            default:
                throw new IllegalArgumentException("Table not setup: " + splitInfo.getTableName());
        }
    }

    private static <T extends TpchEntity> ConnectorPageSource createPageSource(TpchTable<T> table, List<String> columnNames, SplitInfo splitInfo)
    {
        List<TpchColumn<T>> columns = columnNames.stream().map(table::getColumn).collect(toList());
        return new RecordPageSource(createTpchRecordSet(
                table,
                columns,
                schemaNameToScaleFactor(splitInfo.getSchemaName()),
                splitInfo.getPartNumber(),
                splitInfo.getTotalParts(),
                TupleDomain.all()));
    }

    private static List<String> getSchemaNames(String schemaNameOrNull)
    {
        if (schemaNameOrNull == null) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Query only tables registered in the switch (check the deployed ThriftTpchService version)
  2. Add a case for the missing table: createPageSource(TpchTable.<NAME>, columnNames, splitInfo)
  3. Correct the table name in the test query

Example fix

// before
case "supplier":
    return createPageSource(TpchTable.SUPPLIER, columnNames, splitInfo);
default:
    throw new IllegalArgumentException("Table not setup: " + splitInfo.getTableName());
// after
case "supplier":
    return createPageSource(TpchTable.SUPPLIER, columnNames, splitInfo);
case "orders":
    return createPageSource(TpchTable.ORDERS, columnNames, splitInfo);
default:
    throw new IllegalArgumentException("Table not setup: " + splitInfo.getTableName());
Defensive patterns

Strategy: validation

Validate before calling

Set<String> supportedTables = Set.of("nation", "region", "part", "supplier");
if (!supportedTables.contains(tableName)) {
    throw new IllegalArgumentException("table not served by thrift test server: " + tableName);
}

Prevention

When it happens

Trigger: Querying the thrift testing server for a TPCH table that was not registered in createPageSource's switch (e.g., orders, lineitem, if absent in the deployed version).

Common situations: Tests assuming all TPCH tables exist on the thrift testing server; new TPCH tables queried before extending the service; typos in table names in test SQL.

Related errors


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