{"record":{"id":"807205775dd5fdf1","repo":"apache/seatunnel","slug":"please-invoke-deserializationschema-deserialize-by-807205","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/DebeziumJsonDeserializationSchemaDispatcher.java","lineNumber":68,"sourceCode":"\n    private static final String SOURCE = \"source\";\n    private static final String TABLE = \"table\";\n    private static final String SCHEMA = \"schema\";\n    private static final String DATABASE = \"db\";\n    private static final String CONNECTOR = \"connector\";\n\n    public DebeziumJsonDeserializationSchemaDispatcher(\n            Map<TablePath, DebeziumJsonDeserializationSchema> tableDeserializationMap,\n            boolean ignoreParseErrors,\n            boolean debeziumEnabledSchema) {\n        this.tableDeserializationMap = tableDeserializationMap;\n        this.debeziumEnabledSchema = debeziumEnabledSchema;\n        this.ignoreParseErrors = ignoreParseErrors;\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        if (message == null || message.length == 0) {\n            // skip tombstone messages\n            return;\n        }\n\n        try {\n            JsonNode payload = getPayload(JsonUtils.readTree(message));\n            JsonNode source = payload.get(SOURCE);\n            String database = getNodeValue(source, DATABASE);\n            String schema = getNodeValue(source, SCHEMA);\n            String table = getNodeValue(source, TABLE);\n            TablePath tablePath = TablePath.of(database, schema, table);\n            if (tableDeserializationMap.containsKey(tablePath)) {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/debezium/DebeziumJsonDeserializationSchemaDispatcher.java#L50-L86","documentation":"Like the base DebeziumJsonDeserializationSchema, the Dispatcher variant can expand one message into multiple rows (UPDATE_BEFORE + UPDATE_AFTER), so only the collector-based deserialize(byte[], Collector<SeaTunnelRow>) is implemented. The single-row overload deserialize(byte[]) throws UnsupportedOperationException unconditionally.","triggerScenarios":"Calling debeziumEnabledSchema.deserialize(messageBytes) (single-argument overload) instead of deserialize(messageBytes, out) on DebeziumJsonDeserializationSchemaDispatcher.","commonSituations":"Test code and utilities written against the older single-row API; custom engine adapters or SourceReaders that bypass the Collector contract; copy-pasted deserialization snippets from other formats.","solutions":["Switch to deserialize(byte[] message, Collector<SeaTunnelRow> out)","Wrap a buffering Collector if you need rows returned as a list","Update test harnesses to the collector-based API"],"exampleFix":"// before\nSeaTunnelRow row = dispatcher.deserialize(message);\n// after\nList<SeaTunnelRow> rows = new ArrayList<>();\ndispatcher.deserialize(message, row -> rows.add(row)); // adapt to full Collector interface","handlingStrategy":"try-catch","validationCode":"if (!(deserializer instanceof DebeziumJsonDeserializationSchemaDispatcher)) return;\n// always invoke the Collector overload for CDC formats","typeGuard":null,"tryCatchPattern":"try {\n    dispatcher.deserialize(message, collector);\n} catch (UnsupportedOperationException e) {\n    log.error(\"Use deserialize(byte[], Collector<SeaTunnelRow>) for Debezium dispatchers\", e);\n    throw e;\n}","preventionTips":["Standardize on the collector-based DeserializationSchema API","Reject single-row deserialize calls in code review/tests","Abstract CDC deserialization behind a helper that always uses Collector"],"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"}