{"record":{"id":"45adefccd050110d","repo":"apache/flink","slug":"do-not-support-flink-type","errorCode":null,"errorMessage":"Do not support flink type: ","messagePattern":"Do not support flink type: ","errorType":"exception","errorClass":"PbCodegenException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-protobuf/src/main/java/org/apache/flink/formats/protobuf/deserialize/PbCodegenDeserializeFactory.java","lineNumber":48,"sourceCode":"\n/** Codegen factory class which return {@link PbCodegenDeserializer} of different data type. */\npublic class PbCodegenDeserializeFactory {\n    public static PbCodegenDeserializer getPbCodegenDes(\n            Descriptors.FieldDescriptor fd, LogicalType type, PbFormatContext formatContext)\n            throws PbCodegenException {\n        // We do not use FieldDescriptor to check because there's no way to get\n        // element field descriptor of array type.\n        if (type instanceof RowType) {\n            return new PbCodegenRowDeserializer(fd.getMessageType(), (RowType) type, formatContext);\n        } else if (PbFormatUtils.isSimpleType(type)) {\n            return new PbCodegenSimpleDeserializer(fd, type);\n        } else if (type instanceof ArrayType) {\n            return new PbCodegenArrayDeserializer(\n                    fd, ((ArrayType) type).getElementType(), formatContext);\n        } else if (type instanceof MapType) {\n            return new PbCodegenMapDeserializer(fd, (MapType) type, formatContext);\n        } else {\n            throw new PbCodegenException(\"Do not support flink type: \" + type);\n        }\n    }\n\n    public static PbCodegenDeserializer getPbCodegenTopRowDes(\n            Descriptors.Descriptor descriptor, RowType rowType, PbFormatContext formatContext) {\n        return new PbCodegenRowDeserializer(descriptor, rowType, formatContext);\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":57,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-protobuf/src/main/java/org/apache/flink/formats/protobuf/deserialize/PbCodegenDeserializeFactory.java#L30-L57","documentation":"During protobuf codegen for deserialization, the factory dispatches on the Flink LogicalType: RowType, simple types, ArrayType, and MapType are handled; anything else falls through to this PbCodegenException. In practice this means the table schema contains a type the protobuf format cannot map, such as RAW, DISTINCT_TYPE, STRUCTURED_TYPE, or a unsupported root type on a non-proto field path.","triggerScenarios":"A table column typed RAW('...', ...) / MULTISET / structured type used with format='protobuf'; a column whose LogicalType root is not in PbFormatUtils.isSimpleType and not row/array/map.","commonSituations":"Protobuf tables derived from wide catalogs where a helper column (raw type, multiset) was left in the DDL; using types valid in SQL but not representable in proto3.","solutions":["Read the exception message: it prints the exact offending LogicalType — locate that column in the DDL.","Remove or cast the unsupported column (RAW/MULTISET/structured) to a supported type (INT, BIGINT, STRING/VARCHAR, BOOLEAN, FLOAT, DOUBLE, BYTES/VARBINARY, DECIMAL, DATE, TIME, TIMESTAMP, ROW, ARRAY, MAP).","Re-run CREATE TABLE and verify schema validation passes before submitting the job."],"exampleFix":"-- before\nCREATE TABLE pb (\n  id BIGINT,\n  payload RAW\n) WITH ('format'='protobuf', ...);\n-- after\nCREATE TABLE pb (\n  id BIGINT,\n  payload BYTES\n) WITH ('format'='protobuf', ...);","handlingStrategy":"type-guard","validationCode":"static boolean pbSupports(LogicalType t) {\n    return t instanceof RowType\n            || t instanceof ArrayType\n            || t instanceof MapType\n            || PbFormatUtils.isSimpleType(t);\n}\nrowType.getFields().forEach(f -> {\n    if (!pbSupports(f.getType())) throw new IllegalArgumentException(\"Unsupported: \" + f.getName());\n});","typeGuard":"boolean isPbMappable(LogicalType t) {\n    return t instanceof RowType || t instanceof ArrayType || t instanceof MapType\n            || PbFormatUtils.isSimpleType(t);\n}","tryCatchPattern":null,"preventionTips":["Keep protobuf table schemas to primitives, ROW, ARRAY, MAP only.","Validate every nested field, not just top-level, before CREATE TABLE."],"tags":["protobuf","codegen","schema","type-mapping"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}