{"record":{"id":"5aaa816f807a178e","repo":"apache/flink","slug":"please-invoke-deserializationschema-deserialize-by-5aaa81","errorCode":null,"errorMessage":"Please invoke DeserializationSchema#deserialize(byte[], Collector<RowData>) instead.","messagePattern":"Please invoke DeserializationSchema#deserialize\\(byte\\[\\], Collector<RowData>\\) instead\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/debezium/DebeziumJsonDeserializationSchema.java","lineNumber":136,"sourceCode":"                        ignoreParseErrors,\n                        timestampFormat);\n        this.hasMetadata = requestedMetadata.size() > 0;\n        this.metadataConverters =\n                createMetadataConverters(jsonRowType, requestedMetadata, schemaInclude);\n        this.producedTypeInfo = producedTypeInfo;\n        this.schemaInclude = schemaInclude;\n        this.ignoreParseErrors = ignoreParseErrors;\n    }\n\n    @Override\n    public void open(InitializationContext context) throws Exception {\n        genericRowDataList = new ArrayList<>();\n        jsonDeserializer.open(context);\n    }\n\n    @Override\n    public RowData deserialize(byte[] message) {\n        throw new RuntimeException(\n                \"Please invoke DeserializationSchema#deserialize(byte[], Collector<RowData>) instead.\");\n    }\n\n    @Override\n    public void deserialize(byte[] message, Collector<RowData> out) throws IOException {\n        if (message == null || message.length == 0) {\n            // skip tombstone messages\n            return;\n        }\n        genericRowDataList.clear();\n        try {\n            GenericRowData row = (GenericRowData) jsonDeserializer.deserialize(message);\n            GenericRowData payload;\n            if (schemaInclude) {\n                payload = (GenericRowData) row.getField(0);\n            } else {\n                payload = row;\n            }","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/debezium/DebeziumJsonDeserializationSchema.java#L118-L154","documentation":"Thrown by DebeziumJsonDeserializationSchema.deserialize(byte[]) because the single-argument DeserializationSchema method is deliberately unsupported: one Debezium message can yield multiple output rows (UPDATE emits before+after) and needs the collector-based variant. Flink's runtime always uses the collector overload; hitting this means the wrong overload was called directly.","triggerScenarios":"Manually invoking new DebeziumJsonDeserializationSchema(...).deserialize(bytes) — in tests, custom sources, or utilities — instead of deserialize(message, Collector<RowData>).","commonSituations":"Custom source implementations or test harnesses coded against the generic DeserializationSchema interface; code copied from plain-JSON format usage; ad-hoc debugging tools pushing single messages through the schema.","solutions":["Call deserialize(message, collector) and gather rows from the collector","Let Flink's runtime drive the schema (normal Kafka connector usage) instead of manual invocation","In tests, use a list-backed collector to capture all emitted rows (UPDATE yields two)"],"exampleFix":"// before\nRowData row = schema.deserialize(message);\n\n// after\nList<RowData> rows = new ArrayList<>();\nschema.deserialize(message, new CollectedListCollector<>(rows));","handlingStrategy":"type-guard","validationCode":"if (schema instanceof DebeziumJsonDeserializationSchema) {\n    schema.deserialize(msg, collector); // one message -> N rows (UPDATE = 2)\n}","typeGuard":"static boolean needsCollector(DeserializationSchema<RowData> s) {\n    return s instanceof DebeziumJsonDeserializationSchema;\n}","tryCatchPattern":null,"preventionTips":["Always implement the collector overload in custom sources/tests","Expect two emitted rows per Debezium UPDATE event"],"tags":["debezium","cdc","api-misuse","deserialization"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}