apache/seatunnel · warning

Csv file does not support this compress type: {}

Error message

Csv file does not support this compress type: {}

What it means

This warning is emitted by CsvWriteStrategy.getOrCreateOutputStream when the configured compress format is not one of the branches explicitly handled for CSV output. The strategy logs a warning and falls back to an uncompressed stream, still writing the CSV header. The output file therefore will NOT be compressed as the user requested.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/CsvWriteStrategy.java:169

    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);
                        enableWriteHeader(fsDataOutputStream);
                        break;
                    case NONE:
                        fsDataOutputStream = hadoopFileSystemProxy.getOutputStream(filePath);
                        enableWriteHeader(fsDataOutputStream);
                        break;
                    default:
                        log.warn(
                                "Csv file does not support this compress type: {}",
                                compressFormat.getCompressCodec());
                        fsDataOutputStream = hadoopFileSystemProxy.getOutputStream(filePath);
                        enableWriteHeader(fsDataOutputStream);
                        break;
                }
                beingWrittenOutputStream.put(filePath, fsDataOutputStream);
                isFirstWrite.put(filePath, true);
            } catch (IOException e) {
                throw CommonError.fileOperationFailed("CsvFile", "open", filePath, e);
            }
        }
        return fsDataOutputStream;
    }

    private void enableWriteHeader(FSDataOutputStream fsDataOutputStream) throws IOException {
        if (enableHeaderWriter) {
            fsDataOutputStream.write(String.join(",", seaTunnelRowType.getFieldNames()).getBytes());

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change the compress option to a CSV-supported format such as gzip or none
  2. Verify supported compress values in the file connector docs for csv format
  3. Switch file_format to ORC/Parquet if columnar compression codecs are required
  4. Patch CsvWriteStrategy.getOrCreateOutputStream to add the missing codec case if it must be supported

Example fix

// before
sink = {
  file_format = "csv"
  compress = "snappy"
}
// after
sink = {
  file_format = "csv"
  compress = "gzip"
}
Defensive patterns

Strategy: validation

Validate before calling

// verify the compress option before building the CSV sink
List<String> csvSupported = List.of("none", "lzo", "gzip");
if (!csvSupported.contains(compressValue.toLowerCase())) {
    throw new IllegalArgumentException("CSV sink supports only " + csvSupported + ", got: " + compressValue);
}

Prevention

When it happens

Trigger: A CSV file sink configured with a compress codec lacking a case in the switch (e.g. ZSTD/BROTLI); getOrCreateOutputStream runs on first write to a new file, hits the default branch and logs this warning.

Common situations: Reusing a shared sink config across file formats; assuming CSV supports all Hadoop codecs; enum additions in CompressFormat not propagated to CsvWriteStrategy.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/f785c5c87b281fda. Report an issue: GitHub.