{"record":{"id":"d61829595d9e5ab1","repo":"apache/seatunnel","slug":"please-invoke-deserializationschema-deserialize-by-d61829","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/ogg/OggJsonDeserializationSchema.java","lineNumber":116,"sourceCode":"            String database,\n            String table,\n            boolean ignoreParseErrors) {\n        this.catalogTable = catalogTable;\n        this.seaTunnelRowType = catalogTable.getSeaTunnelRowType();\n        this.jsonDeserializer =\n                new JsonDeserializationSchema(catalogTable, false, ignoreParseErrors);\n        this.database = database;\n        this.table = table;\n        this.fieldNames = seaTunnelRowType.getFieldNames();\n        this.fieldCount = seaTunnelRowType.getTotalFields();\n        this.ignoreParseErrors = ignoreParseErrors;\n        this.databasePattern = database == null ? null : Pattern.compile(database);\n        this.tablePattern = table == null ? null : Pattern.compile(table);\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 SeaTunnelDataType<SeaTunnelRow> getProducedType() {\n        return this.seaTunnelRowType;\n    }\n\n    public void deserializeMessage(\n            byte[] message, Collector<SeaTunnelRow> out, TablePath tablePath) {\n\n        if (message == null || message.length == 0) {\n            // skip tombstone messages\n            return;\n        }\n\n        ObjectNode jsonNode;\n        try {","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/ogg/OggJsonDeserializationSchema.java#L98-L134","documentation":"OggJsonDeserializationSchema deliberately does not implement the single-argument deserialize(byte[]) method: Ogg messages must be routed through the collector-based overload so update events can emit multiple rows (update-before + update-after). Calling the byte[]-only variant always throws UnsupportedOperationException as an API-usage guard.","triggerScenarios":"A caller (custom code, tests, or a framework adapter) invokes DeserializationSchema.deserialize(byte[]) directly on an OggJsonDeserializationSchema instance instead of deserialize(byte[], Collector<SeaTunnelRow>).","commonSituations":"Writing a custom SourceReader that uses the simple deserialize API; adapting SeaTunnel formats in Flink-style pipelines; copy-pasting generic deserialization code that ignores the collector contract.","solutions":["Call deserialize(byte[] message, Collector<SeaTunnelRow> out) instead — update the caller to the collector API","If the caller API only offers byte[]-only deserialization, wrap with a small buffering collector that captures emitted rows","Switch to a format whose single-row deserialize is implemented, if multi-row emission isn't needed"],"exampleFix":"// before\nSeaTunnelRow row = oggSchema.deserialize(message);\n// after\nList<SeaTunnelRow> rows = new ArrayList<>();\noggSchema.deserialize(message, rows::add);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    oggSchema.deserialize(message, collector); // collector-based API only\n} catch (UnsupportedOperationException e) {\n    // wrong API used; never happens with collector overload\n    throw new AssertionError(e);\n}","preventionTips":["Always call deserialize(byte[], Collector<SeaTunnelRow>) for Ogg format","Remember Ogg updates emit multiple rows — the byte[]-only API cannot express that","Use a buffering collector when integrating with byte[]-only frameworks"],"tags":["ogg","deserialization","api-misuse","cdc"],"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"}