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
- Query only tables registered in the switch (check the deployed ThriftTpchService version)
- Add a case for the missing table: createPageSource(TpchTable.<NAME>, columnNames, splitInfo)
- 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
- Check the deployed ThriftTpchService switch for supported tables before writing tests
- Add a case per TPCH table when extending the test server
- Verify table names in test SQL against TpchTable entries
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
- Schema is not setup:
- Failed connecting to Hive metastore: ${addresses}
- Only bigint, integer and varchar blocks are supported
- Index join is not supported
- lookup is not supported
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/f3325dcea49d835c.
Report an issue: GitHub.