{"record":{"id":"991876eeeb22cf9e","repo":"apache/seatunnel","slug":"file-format-debezium-json-does-not-support-readi","errorCode":null,"errorMessage":"File format 'debezium_json' does not support reading.","messagePattern":"File format 'debezium_json' does not support reading\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileFormat.java","lineNumber":160,"sourceCode":"        public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {\n            return new CanalJsonWriteStrategy(fileSinkConfig);\n        }\n\n        @Override\n        public ReadStrategy getReadStrategy() {\n            throw new UnsupportedOperationException(\n                    \"File format 'canal_json' does not support reading.\");\n        }\n    },\n    DEBEZIUM_JSON(\"debezium_json\") {\n        @Override\n        public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {\n            return new DebeziumJsonWriteStrategy(fileSinkConfig);\n        }\n\n        @Override\n        public ReadStrategy getReadStrategy() {\n            throw new UnsupportedOperationException(\n                    \"File format 'debezium_json' does not support reading.\");\n        }\n    },\n    MAXWELL_JSON(\"maxwell_json\") {\n        @Override\n        public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {\n            return new MaxWellJsonWriteStrategy(fileSinkConfig);\n        }\n\n        @Override\n        public ReadStrategy getReadStrategy() {\n            throw new UnsupportedOperationException(\n                    \"File format 'maxwell_json' does not support reading.\");\n        }\n    },\n    MARKDOWN(\"md\", \"markdown\") {\n        @Override\n        public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileFormat.java#L142-L178","documentation":"The DEBEZIUM_JSON FileFormat enum member only supports writing (DebeziumJsonWriteStrategy). Invoking getReadStrategy() throws UnsupportedOperationException since debezium_json is not a supported file source format.","triggerScenarios":"File source config with format = \"debezium_json\", or code calling FileFormat.DEBEZIUM_JSON.getReadStrategy() during source startup/read-strategy resolution.","commonSituations":"Reusing a Debezium JSON sink config for a source; attempting to read Change-Data-Capture dumps exported as debezium_json files from disk.","solutions":["Switch the source format to a readable one (text, csv, json, parquet, orc, etc.).","To ingest Debezium CDC streams, use a CDC source connector (e.g. MySQL-CDC) rather than reading debezium_json files.","Check FileFormat support matrix in docs before choosing a format.","Pre-validate the format with a config check that only allows read-capable formats for sources."],"exampleFix":"// before\nformat = \"debezium_json\"\n// after\nformat = \"json\"","handlingStrategy":"validation","validationCode":"FileFormat fmt = FileFormat.valueOf(config.get(\"format\"));\ntry {\n    fmt.getReadStrategy();\n} catch (UnsupportedOperationException e) {\n    throw new IllegalArgumentException(\"debezium_json is write-only; choose a readable format\");\n}","typeGuard":"boolean isReadable(FileFormat fmt) {\n    try { fmt.getReadStrategy(); return true; }\n    catch (UnsupportedOperationException e) { return false; }\n}","tryCatchPattern":"try {\n    fmt.getReadStrategy();\n} catch (UnsupportedOperationException e) {\n    log.error(\"debezium_json cannot be read by the file connector; use a CDC source\", e);\n    throw new IllegalArgumentException(e);\n}","preventionTips":["Treat debezium_json strictly as a sink format.","Use MySQL-CDC/Debezium connectors to consume CDC streams instead of reading exported files.","Probe format capability programmatically in config validation.","Document sink-only formats in team config templates."],"tags":["file-connector","file-format","unsupported-read","cdc-json"],"backgroundTag":"operation-not-supported","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"}