{"record":{"id":"f785c5c87b281fda","repo":"apache/seatunnel","slug":"csv-file-does-not-support-this-compress-type","errorCode":null,"errorMessage":"Csv file does not support this compress type: {}","messagePattern":"Csv file does not support this compress type: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/CsvWriteStrategy.java","lineNumber":169,"sourceCode":"    public FSDataOutputStream getOrCreateOutputStream(@NonNull String filePath) {\n        FSDataOutputStream fsDataOutputStream = beingWrittenOutputStream.get(filePath);\n        if (fsDataOutputStream == null) {\n            try {\n                switch (compressFormat) {\n                    case LZO:\n                        LzopCodec lzo = new LzopCodec();\n                        OutputStream out =\n                                lzo.createOutputStream(\n                                        hadoopFileSystemProxy.getOutputStream(filePath));\n                        fsDataOutputStream = new FSDataOutputStream(out, null);\n                        enableWriteHeader(fsDataOutputStream);\n                        break;\n                    case NONE:\n                        fsDataOutputStream = hadoopFileSystemProxy.getOutputStream(filePath);\n                        enableWriteHeader(fsDataOutputStream);\n                        break;\n                    default:\n                        log.warn(\n                                \"Csv file does not support this compress type: {}\",\n                                compressFormat.getCompressCodec());\n                        fsDataOutputStream = hadoopFileSystemProxy.getOutputStream(filePath);\n                        enableWriteHeader(fsDataOutputStream);\n                        break;\n                }\n                beingWrittenOutputStream.put(filePath, fsDataOutputStream);\n                isFirstWrite.put(filePath, true);\n            } catch (IOException e) {\n                throw CommonError.fileOperationFailed(\"CsvFile\", \"open\", filePath, e);\n            }\n        }\n        return fsDataOutputStream;\n    }\n\n    private void enableWriteHeader(FSDataOutputStream fsDataOutputStream) throws IOException {\n        if (enableHeaderWriter) {\n            fsDataOutputStream.write(String.join(\",\", seaTunnelRowType.getFieldNames()).getBytes());","sourceCodeStart":151,"sourceCodeEnd":187,"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/sink/writer/CsvWriteStrategy.java#L151-L187","documentation":"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.","triggerScenarios":"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.","commonSituations":"Reusing a shared sink config across file formats; assuming CSV supports all Hadoop codecs; enum additions in CompressFormat not propagated to CsvWriteStrategy.","solutions":["Change the compress option to a CSV-supported format such as gzip or none","Verify supported compress values in the file connector docs for csv format","Switch file_format to ORC/Parquet if columnar compression codecs are required","Patch CsvWriteStrategy.getOrCreateOutputStream to add the missing codec case if it must be supported"],"exampleFix":"// before\nsink = {\n  file_format = \"csv\"\n  compress = \"snappy\"\n}\n// after\nsink = {\n  file_format = \"csv\"\n  compress = \"gzip\"\n}","handlingStrategy":"validation","validationCode":"// verify the compress option before building the CSV sink\nList<String> csvSupported = List.of(\"none\", \"lzo\", \"gzip\");\nif (!csvSupported.contains(compressValue.toLowerCase())) {\n    throw new IllegalArgumentException(\"CSV sink supports only \" + csvSupported + \", got: \" + compressValue);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cross-check compress option against the csv file-format docs","Validate sink configs in CI with a dry-run/local job","Inspect output file extensions after test writes to confirm compression applied","Add unit tests asserting each CompressFormat is either handled or rejected"],"tags":["hadoop","file-sink","compression","csv"],"backgroundTag":"unsupported-config-value","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"}