{"record":{"id":"291c9e7bf1ff769b","repo":"prestodb/presto","slug":"unsupported-column-type-291c9e","errorCode":null,"errorMessage":"unsupported column type ","messagePattern":"unsupported column type ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-tpcds/src/main/java/com/facebook/presto/tpcds/statistics/TpcdsTableStatisticsFactory.java","lineNumber":117,"sourceCode":"            return LocalDate.parse((CharSequence) value).toEpochDay();\n        }\n        if (type.equals(BIGINT) || type.equals(INTEGER) || type.equals(DATE)) {\n            return ((Number) value).doubleValue();\n        }\n        if (type instanceof DecimalType) {\n            DecimalType decimalType = (DecimalType) type;\n            if (isShortDecimal(decimalType)) {\n                return parseDouble(Decimals.toString(((Number) value).longValue(), decimalType.getScale()));\n            }\n            if (isLongDecimal(decimalType)) {\n                return parseDouble(Decimals.toString((Slice) value, decimalType.getScale()));\n            }\n            throw new IllegalArgumentException(\"Unexpected decimal type: \" + decimalType);\n        }\n        if (type.equals(DOUBLE)) {\n            return ((Number) value).doubleValue();\n        }\n        throw new IllegalArgumentException(\"unsupported column type \" + type);\n    }\n}\n","sourceCodeStart":99,"sourceCodeEnd":120,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-tpcds/src/main/java/com/facebook/presto/tpcds/statistics/TpcdsTableStatisticsFactory.java#L99-L120","documentation":"TpcdsTableStatisticsFactory.toDouble only supports numeric statistics columns: decimal (short/long) and DOUBLE. When asked to convert a value of any other Type it throws IllegalArgumentException 'unsupported column type'. Statistics conversion is intentionally limited to numeric columns.","triggerScenarios":"toRange invoked for a column whose Type is not DOUBLE or decimal — e.g. VARCHAR, DATE, or BIGINT statistics data passed into the TPC-DS statistics factory path.","commonSituations":"Statistics files listing non-numeric columns with min/max values; schema change making a column non-numeric while old stats remain; bug in code selecting columns for range statistics.","solutions":["Ensure statistics data only contains min/max ranges for numeric (DOUBLE/decimal) columns","Remove or regenerate statistics files that include non-numeric column ranges","Update the stats-generation code to skip unsupported column types","Regenerate table statistics after any schema/type change"],"exampleFix":"// before\n// stats json includes range for varchar column \"comment\"\n// after\n// remove the range entry for non-numeric columns from stats json","handlingStrategy":"validation","validationCode":"if (!(type.equals(DOUBLE) || type instanceof DecimalType)) {\n    throw new IllegalArgumentException(\"Skip range stats for non-numeric column type \" + type);\n}","typeGuard":"boolean supportsRangeStats(Type t) { return t.equals(DOUBLE) || t instanceof DecimalType; }","tryCatchPattern":"try {\n    DoubleRange r = toRange(columnStats);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"unsupported column type\")) {\n        return Optional.empty(); // skip range for unsupported column\n    }\n    throw e;\n}","preventionTips":["Only emit min/max ranges for numeric columns in stats data","Regenerate statistics after column type changes","Filter stats columns by type before conversion"],"tags":["statistics","type-mapping","tpcds"],"backgroundTag":"unsupported-column-type-stats","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"}