apache/seatunnel · error · UnsupportedOperationException
File format 'debezium_json' does not support reading.
Error message
File format 'debezium_json' does not support reading.
What it means
The DEBEZIUM_JSON FileFormat enum member only supports writing (DebeziumJsonWriteStrategy). Invoking getReadStrategy() throws UnsupportedOperationException since debezium_json is not a supported file source format.
Source
Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileFormat.java:160
public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {
return new CanalJsonWriteStrategy(fileSinkConfig);
}
@Override
public ReadStrategy getReadStrategy() {
throw new UnsupportedOperationException(
"File format 'canal_json' does not support reading.");
}
},
DEBEZIUM_JSON("debezium_json") {
@Override
public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {
return new DebeziumJsonWriteStrategy(fileSinkConfig);
}
@Override
public ReadStrategy getReadStrategy() {
throw new UnsupportedOperationException(
"File format 'debezium_json' does not support reading.");
}
},
MAXWELL_JSON("maxwell_json") {
@Override
public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {
return new MaxWellJsonWriteStrategy(fileSinkConfig);
}
@Override
public ReadStrategy getReadStrategy() {
throw new UnsupportedOperationException(
"File format 'maxwell_json' does not support reading.");
}
},
MARKDOWN("md", "markdown") {
@Override
public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {View on GitHub (pinned to cf67b549a7)
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.
Example fix
// before format = "debezium_json" // after format = "json"
Defensive patterns
Strategy: validation
Validate before calling
FileFormat fmt = FileFormat.valueOf(config.get("format"));
try {
fmt.getReadStrategy();
} catch (UnsupportedOperationException e) {
throw new IllegalArgumentException("debezium_json is write-only; choose a readable format");
} Type guard
boolean isReadable(FileFormat fmt) {
try { fmt.getReadStrategy(); return true; }
catch (UnsupportedOperationException e) { return false; }
} Try / catch
try {
fmt.getReadStrategy();
} catch (UnsupportedOperationException e) {
log.error("debezium_json cannot be read by the file connector; use a CDC source", e);
throw new IllegalArgumentException(e);
} Prevention
- 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.
When it happens
Trigger: File source config with format = "debezium_json", or code calling FileFormat.DEBEZIUM_JSON.getReadStrategy() during source startup/read-strategy resolution.
Common situations: Reusing a Debezium JSON sink config for a source; attempting to read Change-Data-Capture dumps exported as debezium_json files from disk.
Related errors
- File format 'canal_json' does not support reading.
- File format 'maxwell_json' does not support reading.
- FORMAT_NOT_SUPPORT
- File format 'markdown' does not support writing.
- FILE_TYPE_INVALID
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/991876eeeb22cf9e.
Report an issue: GitHub.