prestodb/presto · error · UnsupportedOperationException
Unsupported column type:
Error message
Unsupported column type:
What it means
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.
Source
Thrown at presto-hive/src/main/java/com/facebook/presto/hive/GenericHiveRecordCursor.java:573
parseStringColumn(column);
}
else if (isCharType(type)) {
parseStringColumn(column);
}
else if (isStructuralType(hiveTypes[column])) {
parseObjectColumn(column);
}
else if (DATE.equals(type)) {
parseLongColumn(column);
}
else if (TIMESTAMP.equals(type)) {
parseLongColumn(column);
}
else if (type instanceof DecimalType) {
parseDecimalColumn(column);
}
else {
throw new UnsupportedOperationException("Unsupported column type: " + type);
}
}
private void validateType(int fieldId, Class<?> type)
{
if (!types[fieldId].getJavaType().equals(type)) {
// we don't use Preconditions.checkArgument because it requires boxing fieldId, which affects inner loop performance
throw new IllegalArgumentException(String.format("Expected field to be %s, actual %s (field %s)", type, types[fieldId], fieldId));
}
}
@Override
public void close()
{
// some hive input formats are broken and bad things can happen if you close them multiple times
if (closed) {
return;
}View on GitHub (pinned to 55bb57d202)
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
Example fix
-- before CREATE TABLE t (d interval) ...; -- after: store as a supported type CREATE TABLE t (d varchar) ...;
Defensive patterns
Strategy: type-guard
Validate before calling
// check column types before scanning via the generic record cursor
for (ColumnHandle col : columns) {
Type t = types.get(col);
if (!(t instanceof BigintType || t instanceof DecimalType || t instanceof VarcharType /* ... */)) {
throw new IllegalStateException("Record cursor cannot read column type: " + t);
}
} Type guard
boolean recordCursorSupported(Type t) {
return t instanceof BigintType || t instanceof IntegerType || t instanceof DecimalType
|| t instanceof VarcharType || t instanceof BooleanType || t instanceof DoubleType || t instanceof DateType;
} Try / catch
try {
cursor.isNull(field);
} catch (UnsupportedOperationException e) {
if (e.getMessage().startsWith("Unsupported column type:")) {
// switch to the ORC/Parquet page-source reader or exclude the column
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unexpected column type
- HIVE_BAD_DATA
- Expected field to be %s, actual %s (field %s)
- unknown java type
- NOT_SUPPORTED
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/15e4f2720cce8119.
Report an issue: GitHub.