{"record":{"id":"7984f10f3f724cac","repo":"apache/flink","slug":"unknown-type-with-descriptor-and-type","errorCode":null,"errorMessage":"Unknown type with descriptor \"{}\" and type \"{}.\"","messagePattern":"Unknown type with descriptor \"(.+?)\" and type \"(.+?)\\.\"","errorType":"validation","errorClass":"InvalidRecordException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/protobuf/PatchedProtoWriteSupport.java","lineNumber":853,"sourceCode":"    }\n\n    class BytesValueWriter extends FieldWriter {\n        @Override\n        void writeRawValue(Object value) {\n            byte[] byteArray = ((BytesValue) value).getValue().toByteArray();\n            Binary binary = Binary.fromConstantByteArray(byteArray);\n            recordConsumer.addBinary(binary);\n        }\n    }\n\n    private FieldWriter unknownType(FieldDescriptor fieldDescriptor) {\n        String exceptionMsg =\n                \"Unknown type with descriptor \\\"\"\n                        + fieldDescriptor\n                        + \"\\\" and type \\\"\"\n                        + fieldDescriptor.getJavaType()\n                        + \"\\\".\";\n        throw new InvalidRecordException(exceptionMsg);\n    }\n}\n\n/**\n * Minimal schema converter extracting only needed behavior for the patched support. For the test\n * cases we only rely on primitive field mappings, so we can forward directly to the real converter\n * if present; else implement minimal mapping. To minimize risk, we reflectively invoke the original\n * ProtoSchemaConverter if available.\n */\nclass PatchedProtoSchemaConverter {\n    private final ParquetConfiguration configuration;\n\n    PatchedProtoSchemaConverter(ParquetConfiguration configuration) {\n        this.configuration = configuration;\n    }\n\n    MessageType convert(Descriptor descriptor) {\n        try {","sourceCodeStart":835,"sourceCodeEnd":871,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/protobuf/PatchedProtoWriteSupport.java#L835-L871","documentation":"The FieldWriter factory hit a FieldDescriptor whose Java type has no writer implementation in PatchedProtoWriteSupport (beyond the primitives, groups, enums, strings, bytes it handles). unknownType raises InvalidRecordException naming the descriptor and JavaType.","triggerScenarios":"A protobuf field type the writer does not implement - in parquet-proto this typically surfaces for unusual JavaType values; most commonly triggered by unsupported combinations or new protobuf features (e.g. editions-era types) reaching createWriter.","commonSituations":"Exotic proto features or versions of protobuf-java introducing types the patched converter does not cover; custom FieldDescriptors with types outside the supported set.","solutions":["Restrict the proto message to supported field types (varint, floating point, bool, string, bytes, enum, message, group-free maps)","Read the exception message: the descriptor name and JavaType identify the offending field - restructure that field (e.g. wrap in a message or convert to string/bytes)","If you control the format jar, extend the writer with a custom FieldWriter for that type"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Set<FieldDescriptor.JavaType> ok = EnumSet.of(INT, LONG, FLOAT, DOUBLE, BOOLEAN, STRING, BYTE_STRING, ENUM, MESSAGE);\nfor (FieldDescriptor fd : descriptor.getFields()) { if (!ok.contains(fd.getJavaType())) throw new IllegalArgumentException(\"unsupported field: \" + fd.getFullName()); }","typeGuard":null,"tryCatchPattern":"try { writer.write(msg); } catch (InvalidRecordException e) { // parse field name from message; restructure that proto field } ","preventionTips":["Stick to mainstream proto field types in schemas destined for parquet","Read the exception text: it names the exact descriptor and JavaType","Smoke-test one message per schema in CI to catch unsupported types early"],"tags":["parquet","protobuf","unsupported-type","schema"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}