prestodb/presto · error · IllegalArgumentException
Unsupported type:
Error message
Unsupported type:
What it means
StatisticsBuilders.createStatisticsBuilderSupplier() selects a column statistics builder supplier per OrcType. Types it cannot produce statistics for (falling to default) trigger IllegalArgumentException("Unsupported type: ..."). It is an exhaustiveness guard during column statistics construction when writing ORC files.
Source
Thrown at presto-orc/src/main/java/com/facebook/presto/orc/metadata/statistics/StatisticsBuilders.java:61
case LONG:
return IntegerStatisticsBuilder::new;
case FLOAT:
case DOUBLE:
return DoubleStatisticsBuilder::new;
case BINARY:
return BinaryStatisticsBuilder::new;
case VARCHAR:
case STRING:
int stringStatisticsLimit = columnWriterOptions.getStringStatisticsLimit();
return () -> new StringStatisticsBuilder(stringStatisticsLimit);
case TIMESTAMP:
case TIMESTAMP_MICROSECONDS:
case LIST:
case MAP:
case STRUCT:
return CountStatisticsBuilder::new;
default:
throw new IllegalArgumentException("Unsupported type: " + orcType);
}
}
public static Map<Integer, ColumnStatistics> createEmptyColumnStatistics(List<OrcType> orcTypes, int nodeIndex, ColumnWriterOptions columnWriterOptions)
{
requireNonNull(orcTypes, "orcTypes is null");
checkArgument(nodeIndex >= 0, "Invalid nodeIndex value: %s", nodeIndex);
ImmutableMap.Builder<Integer, ColumnStatistics> columnStatistics = ImmutableMap.builder();
LinkedList<Integer> stack = new LinkedList<>();
stack.add(nodeIndex);
while (!stack.isEmpty()) {
int node = stack.removeLast();
OrcType orcType = orcTypes.get(node);
stack.addAll(orcType.getFieldTypeIndexes());
StatisticsBuilder statisticsBuilder = createStatisticsBuilderSupplier(orcType, columnWriterOptions).get();View on GitHub (pinned to 55bb57d202)
Solutions
- Upgrade presto-orc so the type has a statistics builder mapping
- Cast/replace the offending column type with one that has statistics support
- Add the missing mapping in StatisticsBuilders if maintaining a fork (use CountStatisticsBuilder::new for opaque types)
Example fix
// before
throw new IllegalArgumentException("Unsupported type: " + orcType);
// after
case JSON:
case QUANTIZED_TOTAL_ORDER:
return CountStatisticsBuilder::new; // add missing mapping Defensive patterns
Strategy: validation
Validate before calling
// Verify the ORC column types have statistics builders before configuring the writer
for (OrcType t : orcTypes) {
checkArgument(SUPPORTED_STAT_TYPES.contains(t.getOrcTypeKind()), "No statistics builder for ORC type %s", t);
} Try / catch
try {
supplier = StatisticsBuilders.createStatisticsBuilderSupplier(columnWriterOptions, orcType);
} catch (IllegalArgumentException e) {
if (e.getMessage() != null && e.getMessage().startsWith("Unsupported type:")) {
supplier = CountStatisticsBuilder::new; // degrade to row-count-only stats
} else { throw e; }
} Prevention
- Upgrade presto-orc before writing new OrcType kinds
- Round-trip write/read tests covering every column type in the schema
- Keep StatisticsBuilders switch exhaustive when forking
When it happens
Trigger: Creating a statistics builder for an OrcType whose case is missing from the switch (e.g. certain nested or newer types), invoked from statisticsBuilder during writer setup.
Common situations: Writing ORC files with column types lacking dedicated statistics support; forks adding new OrcType kinds without updating StatisticsBuilders; version skew after upgrades.
Related errors
- Unsupported type:
- Unsupported type:
- Number of values not set for orc file. Set session property
- Unexpected multiple column statistics for node %s in row gro
- Write validation failed: unexpected number of columns in %s
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/d91408ce47d0c6e4.
Report an issue: GitHub.