apache/flink · error · UnsupportedOperationException
Unsupported type: {}
Error message
Unsupported type: {} What it means
ParquetRowDataWriter.createWriter throws for primitive LogicalTypes it has no writer for (the switch's default branch). The writer covers CHAR, VARCHAR, BOOLEAN, INT families, BIGINT, FLOAT, DOUBLE and timestamps; anything else falling into the primitive case is unsupported.
Source
Thrown at flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/row/ParquetRowDataWriter.java:146
return new ShortWriter();
case DATE:
case TIME_WITHOUT_TIME_ZONE:
case INTEGER:
return new IntWriter();
case BIGINT:
return new LongWriter();
case FLOAT:
return new FloatWriter();
case DOUBLE:
return new DoubleWriter();
case TIMESTAMP_WITHOUT_TIME_ZONE:
TimestampType timestampType = (TimestampType) t;
return new TimestampWriter(timestampType.getPrecision());
case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
LocalZonedTimestampType localZonedTimestampType = (LocalZonedTimestampType) t;
return new TimestampWriter(localZonedTimestampType.getPrecision());
default:
throw new UnsupportedOperationException("Unsupported type: " + type);
}
} else {
GroupType groupType = type.asGroupType();
LogicalTypeAnnotation logicalType = type.getLogicalTypeAnnotation();
if (t instanceof ArrayType
&& logicalType instanceof LogicalTypeAnnotation.ListLogicalTypeAnnotation) {
return new ArrayWriter(((ArrayType) t).getElementType(), groupType);
} else if (t instanceof MapType
&& logicalType instanceof LogicalTypeAnnotation.MapLogicalTypeAnnotation) {
return new MapWriter(
((MapType) t).getKeyType(), ((MapType) t).getValueType(), groupType);
} else if (t instanceof MultisetType
&& logicalType instanceof LogicalTypeAnnotation.MapLogicalTypeAnnotation) {
return new MapWriter(
((MultisetType) t).getElementType(), new IntType(false), groupType);
} else if (t instanceof RowType && type instanceof GroupType) {
return new RowWriter((RowType) t, groupType);View on GitHub (pinned to 2f3c205e92)
Solutions
- Inspect the reported type in the message; normalize it to a supported Flink LogicalType before writing
- Cast/convert the column upstream (e.g. in SQL: CAST(col AS <supported type>))
- Ensure you pass standard planner-produced RowData schemas, not hand-built LogicalType instances
Defensive patterns
Strategy: validation
Validate before calling
static boolean isSupportedPrimitive(LogicalType t) {
switch (t.getTypeRoot()) {
case CHAR: case VARCHAR: case BOOLEAN: case TINYINT: case SMALLINT:
case INTEGER: case BIGINT: case FLOAT: case DOUBLE:
case TIMESTAMP_WITHOUT_TIME_ZONE: case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
return true;
default: return false;
}
} Try / catch
try { writer.write(row); } catch (UnsupportedOperationException e) { if (e.getMessage().startsWith("Unsupported type")) { /* normalize/drop the offending column, rebuild writer */ } throw e; } Prevention
- Validate the RowType against supported roots before opening the parquet writer
- Prefer planner-generated schemas over hand-built LogicalTypes
- Cast exotic types to supported ones upstream in the SQL/DataStream pipeline
When it happens
Trigger: Writing a RowData whose primitive column type is outside the handled set - most commonly a distinct type not normalized, or future/new LogicalTypes hitting the default branch of the primitive switch.
Common situations: Custom LogicalType subclasses passed through instead of standard table types; type mismatches where a DECIMAL/DATE/TIME is unexpectedly routed (these are handled elsewhere, but a non-standard variant reaches the default).
Related errors
- Time unit not recognized
- Unsupported type: {}
- Error while waiting for job to be initialized
- Translator {} cannot translate the given pipeline {}.
- Could not get job jar and dependencies from JAR file: {}
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/2052a44db0af087e.
Report an issue: GitHub.