{"record":{"id":"e565a9cd4689dae5","repo":"prestodb/presto","slug":"unsupported-tpc-ds-type","errorCode":null,"errorMessage":"Unsupported TPC-DS type ","messagePattern":"Unsupported TPC-DS type ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-tpcds/src/main/java/com/facebook/presto/tpcds/TpcdsMetadata.java","lineNumber":272,"sourceCode":"            case IDENTIFIER:\n                return BigintType.BIGINT;\n            case INTEGER:\n                return IntegerType.INTEGER;\n            case DATE:\n                return DateType.DATE;\n            case DECIMAL:\n                return createDecimalType(tpcdsType.getPrecision().get(), tpcdsType.getScale().get());\n            case CHAR:\n                if (useVarcharType) {\n                    return createVarcharType(tpcdsType.getPrecision().get());\n                }\n                return createCharType(tpcdsType.getPrecision().get());\n            case VARCHAR:\n                return createVarcharType(tpcdsType.getPrecision().get());\n            case TIME:\n                return TimeType.TIME;\n        }\n        throw new IllegalArgumentException(\"Unsupported TPC-DS type \" + tpcdsType);\n    }\n}\n","sourceCodeStart":254,"sourceCodeEnd":275,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-tpcds/src/main/java/com/facebook/presto/tpcds/TpcdsMetadata.java#L254-L275","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nswitch (tpcdsType.getBase()) { ... }\n// after\nswitch (tpcdsType.getBase()) {\n    case DATE:\n        return DateType.DATE;\n    // ... existing cases ...\n}","handlingStrategy":"try-catch","validationCode":"// Check the TPC-DS table's column types are all in the mapped set before use\nSet<String> supported = Set.of(\"DECIMAL\",\"CHAR\",\"VARCHAR\",\"TIME\",\"DATE\",\"INTEGER\",\"BIGINT\",\"DOUBLE\");\n// for each column base type in the table definition assert supported.contains(base)","typeGuard":null,"tryCatchPattern":"try {\n    TableMetadata tm = metadata.getTableMetadata(session, tableHandle);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported TPC-DS type\")) {\n        throw new IllegalStateException(\"Connector does not support a TPC-DS type in this table; upgrade Presto\", e);\n    }\n    throw e;\n}","preventionTips":["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"],"tags":["type-mapping","tpcds","metadata"],"backgroundTag":"unsupported-type-mapping","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"}