apache/seatunnel · warning
CanalJson file does not support this compress type: {}
Error message
CanalJson file does not support this compress type: {} What it means
This is a non-fatal warning logged by CanalJsonWriteStrategy.getOrCreateOutputStream when the configured file compress format has no dedicated codec branch in the switch statement. The writer falls back to writing an uncompressed output stream instead of failing. It signals that the chosen compress format (e.g. LZO, ZSTD for this format) is not wired up for Canal JSON text output.
Source
Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/CanalJsonWriteStrategy.java:141
@Override
public FSDataOutputStream getOrCreateOutputStream(@NonNull String filePath) {
FSDataOutputStream fsDataOutputStream = beingWrittenOutputStream.get(filePath);
if (fsDataOutputStream == null) {
try {
switch (compressFormat) {
case LZO:
LzopCodec lzo = new LzopCodec();
OutputStream out =
lzo.createOutputStream(
hadoopFileSystemProxy.getOutputStream(filePath));
fsDataOutputStream = new FSDataOutputStream(out, null);
break;
case NONE:
fsDataOutputStream = hadoopFileSystemProxy.getOutputStream(filePath);
break;
default:
log.warn(
"CanalJson file does not support this compress type: {}",
compressFormat.getCompressCodec());
fsDataOutputStream = hadoopFileSystemProxy.getOutputStream(filePath);
break;
}
beingWrittenOutputStream.put(filePath, fsDataOutputStream);
isFirstWrite.put(filePath, true);
} catch (IOException e) {
throw CommonError.fileOperationFailed("CanalJsonFile", "open", filePath, e);
}
}
return fsDataOutputStream;
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Set compress=lz4/gzip/none (a compress format supported by the Canal JSON writer) in the sink options
- Check SeaTunnel docs for compress formats supported by canal_json text output
- If you need the unsupported codec, change file_format to one that supports it (e.g. ORC/Parquet) or pre-compress via an archive compress option
- If the format should be supported, add a case in CanalJsonWriteStrategy.getOrCreateOutputStream wrapping the stream with the proper compression codec
Example fix
// before
sink = {
file_format = "canal_json"
compress = "zstd"
}
// after
sink = {
file_format = "canal_json"
compress = "gzip"
} Defensive patterns
Strategy: validation
Validate before calling
// before submitting the job, check the compress value against supported text codecs
Set<String> supported = Set.of("none", "lzo", "gzip");
if (!supported.contains(config.get("compress").toLowerCase())) {
throw new IllegalArgumentException("compress=" + config.get("compress") + " not supported for canal_json; use " + supported);
} Prevention
- Only use compress values documented for the specific file_format
- Keep per-format sink configs separate instead of templating one compress value across formats
- Watch logs for this warning in test runs before production
- After changing CompressFormat enums, grep all WriteStrategy classes for missing switch cases
When it happens
Trigger: Configuring a Canal JSON file sink with file_format=canal_json and a compress option whose CompressFormat has a codec string but no case in the switch (anything other than LZO/GZIP/NONE handled branches), e.g. compress=ZSTD, then starting a job so getOrCreateOutputStream opens the per-file stream.
Common situations: Users copy a compress setting from an ORC/Parquet sink into a text-based canal_json sink; upgrade/regression where a new CompressFormat enum value was added without updating CanalJsonWriteStrategy; typos resolving to an unexpected default codec.
Related errors
- Csv file does not support this compress type: {}
- DebeziumJson file does not support this compress type: {}
- Json file does not support this compress type: {}
- MaxWellJson file does not support this compress type: {}
- Text file does not support this compress type: {}
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/b88869cf69b79871.
Report an issue: GitHub.