prestodb/presto · error · IllegalArgumentException
Unsupported TPC-DS type
Error message
Unsupported TPC-DS type
What it means
TpcdsMetadata.getPrestoType maps TPC-DS column types to Presto types; when it encounters a TpcdsType with no case in its switch it throws IllegalArgumentException 'Unsupported TPC-DS type'. This guards against new or unmapped TPC-DS types reaching the connector.
Source
Thrown at presto-tpcds/src/main/java/com/facebook/presto/tpcds/TpcdsMetadata.java:272
case IDENTIFIER:
return BigintType.BIGINT;
case INTEGER:
return IntegerType.INTEGER;
case DATE:
return DateType.DATE;
case DECIMAL:
return createDecimalType(tpcdsType.getPrecision().get(), tpcdsType.getScale().get());
case CHAR:
if (useVarcharType) {
return createVarcharType(tpcdsType.getPrecision().get());
}
return createCharType(tpcdsType.getPrecision().get());
case VARCHAR:
return createVarcharType(tpcdsType.getPrecision().get());
case TIME:
return TimeType.TIME;
}
throw new IllegalArgumentException("Unsupported TPC-DS type " + tpcdsType);
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Upgrade the Presto version so the connector maps the new TPC-DS type
- Add a case for the missing TpcdsType in getPrestoType returning the appropriate Presto Type
- Pin the tpcds generator dependency to a version whose types are all supported
- Check which table/type triggers it and avoid that table until fixed
Example fix
// before
switch (tpcdsType.getBase()) { ... }
// after
switch (tpcdsType.getBase()) {
case DATE:
return DateType.DATE;
// ... existing cases ...
} Defensive patterns
Strategy: try-catch
Validate before calling
// Check the TPC-DS table's column types are all in the mapped set before use
Set<String> supported = Set.of("DECIMAL","CHAR","VARCHAR","TIME","DATE","INTEGER","BIGINT","DOUBLE");
// for each column base type in the table definition assert supported.contains(base) Try / catch
try {
TableMetadata tm = metadata.getTableMetadata(session, tableHandle);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Unsupported TPC-DS type")) {
throw new IllegalStateException("Connector does not support a TPC-DS type in this table; upgrade Presto", e);
}
throw e;
} Prevention
- Keep the Presto tpcds generator dependency version aligned with the connector
- Test catalog creation against all TPC-DS tables after upgrades
- Patch getPrestoType to cover new TpcdsType enum values before deploying
When it happens
Trigger: getTableMetadata iterating a TPC-DS table whose generated column type is not DECIMAL/CHAR/VARCHAR/TIME/etc. handled by the switch — typically after adding a newer TPC-DS schema version with types the connector doesn't map.
Common situations: Upgrading the tpcds generator library to a version emitting new types; querying a TPC-DS table whose type mapping was never implemented in this connector version.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/e565a9cd4689dae5.
Report an issue: GitHub.