{"record":{"id":"15e4f2720cce8119","repo":"prestodb/presto","slug":"unsupported-column-type","errorCode":null,"errorMessage":"Unsupported column type: ","messagePattern":"Unsupported column type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/GenericHiveRecordCursor.java","lineNumber":573,"sourceCode":"            parseStringColumn(column);\n        }\n        else if (isCharType(type)) {\n            parseStringColumn(column);\n        }\n        else if (isStructuralType(hiveTypes[column])) {\n            parseObjectColumn(column);\n        }\n        else if (DATE.equals(type)) {\n            parseLongColumn(column);\n        }\n        else if (TIMESTAMP.equals(type)) {\n            parseLongColumn(column);\n        }\n        else if (type instanceof DecimalType) {\n            parseDecimalColumn(column);\n        }\n        else {\n            throw new UnsupportedOperationException(\"Unsupported column type: \" + type);\n        }\n    }\n\n    private void validateType(int fieldId, Class<?> type)\n    {\n        if (!types[fieldId].getJavaType().equals(type)) {\n            // we don't use Preconditions.checkArgument because it requires boxing fieldId, which affects inner loop performance\n            throw new IllegalArgumentException(String.format(\"Expected field to be %s, actual %s (field %s)\", type, types[fieldId], fieldId));\n        }\n    }\n\n    @Override\n    public void close()\n    {\n        // some hive input formats are broken and bad things can happen if you close them multiple times\n        if (closed) {\n            return;\n        }","sourceCodeStart":555,"sourceCodeEnd":591,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/GenericHiveRecordCursor.java#L555-L591","documentation":"GenericHiveRecordCursor.parseColumn dispatches to a type-specific parser based on the column's Hive type (long, decimal, etc.). If the column's Type is not one of the supported families, it throws UnsupportedOperationException 'Unsupported column type: <type>'. The Hive record-cursor reader path simply does not implement parsing for that type.","triggerScenarios":"Scanning a Hive table (record cursor path) with a column whose type falls outside the implemented set — e.g. interval, certain complex or newly added types — via isNull/parseColumn during row reads.","commonSituations":"Reading exotic Hive column types with the generic record reader, tables created by newer engines with types Presto's record cursor predates, or misdeclared column types.","solutions":["Upgrade Presto so the record cursor supports the column type","Rewrite the table to a supported format (ORC/Parquet) and/or supported column types","Cast or restructure the offending column into a supported type (e.g. store as varchar)","Force the newer native/ORC reader path instead of the generic Hive record cursor"],"exampleFix":"-- before\nCREATE TABLE t (d interval) ...;\n-- after: store as a supported type\nCREATE TABLE t (d varchar) ...;","handlingStrategy":"type-guard","validationCode":"// check column types before scanning via the generic record cursor\nfor (ColumnHandle col : columns) {\n    Type t = types.get(col);\n    if (!(t instanceof BigintType || t instanceof DecimalType || t instanceof VarcharType /* ... */)) {\n        throw new IllegalStateException(\"Record cursor cannot read column type: \" + t);\n    }\n}","typeGuard":"boolean recordCursorSupported(Type t) {\n    return t instanceof BigintType || t instanceof IntegerType || t instanceof DecimalType\n        || t instanceof VarcharType || t instanceof BooleanType || t instanceof DoubleType || t instanceof DateType;\n}","tryCatchPattern":"try {\n    cursor.isNull(field);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().startsWith(\"Unsupported column type:\")) {\n        // switch to the ORC/Parquet page-source reader or exclude the column\n    }\n    throw e;\n}","preventionTips":["Restrict record-cursor tables to supported column types","Convert tables to ORC/Parquet to use the page-source readers","Re-check type support after Presto upgrades before enabling new types"],"tags":["hive","record-cursor","unsupported-type"],"backgroundTag":"unsupported-column-type","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"}