{"record":{"id":"1e8cc2117d11af1b","repo":"apache/flink","slug":"unsupported-data-type-in-schema","errorCode":null,"errorMessage":"Unsupported data type in schema: ","messagePattern":"Unsupported data type in schema: ","errorType":"exception","errorClass":"PbCodegenException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-protobuf/src/main/java/org/apache/flink/formats/protobuf/serialize/PbCodegenSimpleSerializer.java","lineNumber":114,"sourceCode":"                    appender.begin(\"if(null == \" + enumValueDescVar + \"){\");\n                    // choose the first enum element as default value if such value is invalid enum\n                    appender.appendLine(resultVar + \" = \" + enumTypeStr + \".values()[0]\");\n                    appender.end(\"}\");\n                    appender.begin(\"else{\");\n                    // choose the exact enum value\n                    appender.appendLine(\n                            resultVar + \" = \" + enumTypeStr + \".valueOf(\" + enumValueDescVar + \")\");\n                    appender.end(\"}\");\n                } else {\n                    appender.appendLine(resultVar + \" = \" + fromVar);\n                }\n                return appender.code();\n            case VARBINARY:\n            case BINARY:\n                appender.appendLine(resultVar + \" = ByteString.copyFrom(\" + flinkObjectCode + \")\");\n                return appender.code();\n            default:\n                throw new PbCodegenException(\"Unsupported data type in schema: \" + type);\n        }\n    }\n}\n","sourceCodeStart":96,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-protobuf/src/main/java/org/apache/flink/formats/protobuf/serialize/PbCodegenSimpleSerializer.java#L96-L118","documentation":"PbCodegenSimpleSerializer's switch on the Flink type root has a default branch that throws for any type not handled (the message includes the type). This fires at codegen time when a column's LogicalTypeRoot has no protobuf serialization mapping — e.g. type roots added by newer Flink versions or exotic types used on a simple proto field.","triggerScenarios":"A sink column with a type root outside the supported set (e.g. MULTISET, STRUCTURED_TYPE, DISTINCT_TYPE, SYMBOL, untime-window types) mapped to a proto scalar field.","commonSituations":"Schema evolution in catalogs introducing new type roots; DDLs that worked on one Flink version failing after upgrade because a type became representable but not protobuf-mappable.","solutions":["Use the type in the exception to find the column; cast it in the SELECT/DDL to a supported root (INT, BIGINT, VARCHAR, BOOLEAN, FLOAT, DOUBLE, VARBINARY, DECIMAL, DATE, TIME, TIMESTAMP, CHAR).","Remove the column from the sink projection.","If the type should be supported, check for an upstream fix or file a JIRA in flink-formats/flink-protobuf."],"exampleFix":"-- before\nSELECT id, tags FROM src;  -- tags MULTISET<STRING>\n-- after\nSELECT id, MAP_KEYS(tags) AS tag_array FROM src;  -- ARRAY<STRING>","handlingStrategy":"validation","validationCode":"switch (type.getTypeRoot()) {\n    case MULTISET: case STRUCTURED_TYPE: case DISTINCT_TYPE: case RAW: case SYMBOL:\n        throw new IllegalArgumentException(\"Not protobuf-serializable: \" + type);\n    // else ok\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cast away unsupported types in the SELECT (e.g. ARRAY instead of MULTISET).","Re-validate sink schemas after Flink upgrades — supported type sets change."],"tags":["protobuf","codegen","serialization","schema"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}