apache/flink · error · IllegalArgumentException
Unsupported data type in schema:
Error message
Unsupported data type in schema:
What it means
PbCodegenUtils generates the RowData accessor call (getInt/getString/getRow/...) by switching on the element's type root. The default branch throws IllegalArgumentException for type roots with no RowData accessor mapping — effectively any type the protobuf codegen does not support appearing where an accessor must be generated.
Source
Thrown at flink-formats/flink-protobuf/src/main/java/org/apache/flink/formats/protobuf/util/PbCodegenUtils.java:71
case DOUBLE:
return flinkContainerCode + ".getDouble(" + index + ")";
case BOOLEAN:
return flinkContainerCode + ".getBoolean(" + index + ")";
case VARCHAR:
case CHAR:
return flinkContainerCode + ".getString(" + index + ")";
case VARBINARY:
case BINARY:
return flinkContainerCode + ".getBinary(" + index + ")";
case ROW:
int size = eleType.getChildren().size();
return flinkContainerCode + ".getRow(" + index + ", " + size + ")";
case MAP:
return flinkContainerCode + ".getMap(" + index + ")";
case ARRAY:
return flinkContainerCode + ".getArray(" + index + ")";
default:
throw new IllegalArgumentException("Unsupported data type in schema: " + eleType);
}
}
/**
* Get java type str from {@link FieldDescriptor} which directly fetched from protobuf object.
*
* @return The returned code phrase will be used as java type str in codegen sections.
* @throws PbCodegenException
*/
public static String getTypeStrFromProto(FieldDescriptor fd, boolean isList)
throws PbCodegenException {
String typeStr;
switch (fd.getJavaType()) {
case MESSAGE:
if (fd.isMapField()) {
// map
FieldDescriptor keyFd =
fd.getMessageType().findFieldByName(PbConstant.PB_MAP_KEY_NAME);View on GitHub (pinned to 2f3c205e92)
Solutions
- Flatten or cast the offending nested field to supported types (primitives, ROW, ARRAY, MAP).
- Move computed/unsupported columns out of the protobuf-mapped part of the plan.
- Search the exception's stack for the calling codegen class to identify which field triggered accessor generation.
Defensive patterns
Strategy: validation
Validate before calling
void assertAccessorExists(LogicalType t) {
switch (t.getTypeRoot()) {
case MULTISET: case STRUCTURED_TYPE: case DISTINCT_TYPE: case RAW:
throw new IllegalArgumentException("No RowData accessor codegen for " + t);
default:
}
} Prevention
- Keep every nested level of protobuf-mapped schemas to primitives/ROW/ARRAY/MAP.
- Add a CI schema check that walks the full RowType tree before deployment.
When it happens
Trigger: Codegen needs to read a field whose LogicalTypeRoot is not in the switch (e.g. MULTISET, STRUCTURED_TYPE, DISTINCT_TYPE, RAW) inside a row/array/map being (de)serialized by the protobuf format.
Common situations: Deeply nested schemas with unsupported intermediate types; views that introduce multiset/structured types into a protobuf-mapped projection.
Related errors
- Do not support flink type:
- Do not support flink data type:
- Illegal type for protobuf enum, only char/vachar/int/bigint
- Unsupported protobuf simple type:
- Unsupported data type in schema:
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/0af4480aa99a4cfb.
Report an issue: GitHub.