{"record":{"id":"7ceb75e6c558a624","repo":"apache/seatunnel","slug":"file-format-maxwell-json-does-not-support-readin","errorCode":null,"errorMessage":"File format 'maxwell_json' does not support reading.","messagePattern":"File format 'maxwell_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":172,"sourceCode":"        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) {\n            throw new UnsupportedOperationException(\n                    \"File format 'markdown' does not support writing.\");\n        }\n\n        @Override\n        public ReadStrategy getReadStrategy() {\n            return new MarkdownReadStrategy();\n        }\n    },\n    PDF(\"pdf\") {\n        @Override\n        public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {","sourceCodeStart":154,"sourceCodeEnd":190,"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#L154-L190","documentation":"The MAXWELL_JSON FileFormat enum member only supports writing (MaxWellJsonWriteStrategy). Calling getReadStrategy() throws UnsupportedOperationException because maxwell_json cannot be used as a file source format.","triggerScenarios":"File source configured with format = \"maxwell_json\"; read-strategy resolution invokes FileFormat.MAXWELL_JSON.getReadStrategy().","commonSituations":"Copy-pasted sink config into a source; trying to read exported Maxwell CDC JSON files with the file connector.","solutions":["Change the source format to a supported readable format (text, csv, json, parquet, orc).","Use an appropriate CDC source connector instead of reading Maxwell JSON files via the file connector.","Validate format capability (read vs write) against the FileFormat enum during config authoring.","Keep maxwell_json only on sink-side configurations."],"exampleFix":"// before\nformat = \"maxwell_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(\"maxwell_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(\"maxwell_json cannot be read by the file connector\", e);\n    throw new IllegalArgumentException(e);\n}","preventionTips":["Treat maxwell_json strictly as a sink format.","Use the Maxwell/CDC source connector for change data instead of reading files.","Validate source format capability during config authoring.","Avoid copy-pasting sink format values into source configs."],"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"}