{"record":{"id":"8dff9388cf1576c7","repo":"apache/seatunnel","slug":"please-invoke-deserializationschema-deserialize-by-8dff93","errorCode":null,"errorMessage":"Please invoke DeserializationSchema#deserialize(byte[], Collector<SeaTunnelRow>) instead.","messagePattern":"Please invoke DeserializationSchema#deserialize\\(byte\\[\\], Collector<SeaTunnelRow>\\) instead\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/debezium/DebeziumJsonDeserializationSchema.java","lineNumber":88,"sourceCode":"\n    public DebeziumJsonDeserializationSchema(CatalogTable catalogTable, boolean ignoreParseErrors) {\n        this(catalogTable, ignoreParseErrors, false);\n    }\n\n    public DebeziumJsonDeserializationSchema(\n            CatalogTable catalogTable, boolean ignoreParseErrors, boolean debeziumEnabledSchema) {\n        this.rowType = catalogTable.getSeaTunnelRowType();\n        this.ignoreParseErrors = ignoreParseErrors;\n        this.jsonDeserializer =\n                new JsonDeserializationSchema(catalogTable, false, ignoreParseErrors);\n        this.debeziumRowConverter = new DebeziumRowConverter(rowType);\n        this.debeziumEnabledSchema = debeziumEnabledSchema;\n        this.tablePath = Optional.of(catalogTable).map(CatalogTable::getTablePath).orElse(null);\n    }\n\n    @Override\n    public SeaTunnelRow deserialize(byte[] message) throws IOException {\n        throw new UnsupportedOperationException(\n                \"Please invoke DeserializationSchema#deserialize(byte[], Collector<SeaTunnelRow>) instead.\");\n    }\n\n    @Override\n    public void deserialize(byte[] message, Collector<SeaTunnelRow> out) {\n        deserializeMessage(message, out, tablePath);\n    }\n\n    public void deserializeMessage(\n            byte[] message, Collector<SeaTunnelRow> out, TablePath tablePath) {\n        if (message == null || message.length == 0) {\n            // skip tombstone messages\n            return;\n        }\n\n        try {\n            JsonNode payload = getPayload(jsonDeserializer.deserializeToJsonNode(message));\n            parsePayload(out, tablePath, payload);","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/debezium/DebeziumJsonDeserializationSchema.java#L70-L106","documentation":"A Debezium JSON message can expand into multiple SeaTunnelRows (an UPDATE yields UPDATE_BEFORE + UPDATE_AFTER), so this DeserializationSchema only supports the collector-based entry point deserialize(byte[], Collector<SeaTunnelRow>). The single-row overload deserialize(byte[]) cannot honor that contract and unconditionally throws UnsupportedOperationException.","triggerScenarios":"Calling deserializer.deserialize(messageBytes) directly (the single-argument overload) instead of deserialize(messageBytes, collector) — in custom code, test harnesses, or engine adapters written against the old single-row API.","commonSituations":"Unit tests exercising the Debezium JSON format with the wrong overload; a custom SourceReader collecting rows without a Collector; connector code written before the collector-based API became standard.","solutions":["Change the call site to deserialize(byte[] message, Collector<SeaTunnelRow> out)","If a synchronous result is needed, pass a collector implementation that buffers rows and read them after the call","Update test harnesses and any engine adapters to the collector-based API"],"exampleFix":"// before\nSeaTunnelRow row = debeziumDeserializer.deserialize(message);\n// after\nList<SeaTunnelRow> rows = new ArrayList<>();\ndeziumDeserializer.deserialize(message, new Collector<SeaTunnelRow>() {\n    public void collect(SeaTunnelRow r) { rows.add(r); }\n    public Object getCheckpointLock() { return this; }\n    public void close() {}\n});","handlingStrategy":"try-catch","validationCode":"// ensure the call site uses the Collector overload\nif (collector == null) throw new IllegalArgumentException(\"Must call deserialize(byte[], Collector<SeaTunnelRow>)\");","typeGuard":null,"tryCatchPattern":"try {\n    deserializer.deserialize(message, collector);\n} catch (UnsupportedOperationException e) {\n    // wrong overload used; switch call site to collector-based API\n}","preventionTips":["Never call the single-row deserialize on CDC formats","Wrap collectors once in a shared utility","Add API-usage lint checks in connector code"],"tags":["cdc","api-misuse","deserialization","unsupported-method"],"backgroundTag":"method-not-implemented","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}