{"record":{"id":"ae63c03e809ed7e5","repo":"apache/seatunnel","slug":"text-file-does-not-support-this-compress-type","errorCode":null,"errorMessage":"Text file does not support this compress type: {}","messagePattern":"Text 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/TextWriteStrategy.java","lineNumber":163,"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                                \"Text 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(\"TextFile\", \"open\", filePath, e);\n            }\n        }\n        return fsDataOutputStream;\n    }\n\n    private void enableWriteHeader(FSDataOutputStream fsDataOutputStream) throws IOException {\n        if (enableHeaderWriter) {\n            fsDataOutputStream.write(","sourceCodeStart":145,"sourceCodeEnd":181,"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/TextWriteStrategy.java#L145-L181","documentation":"This warning is emitted by TextWriteStrategy.getOrCreateOutputStream when the configured compress format is not one of the branches handled for plain-text output. The strategy falls back to writing an uncompressed stream (still writing the configured header), so the compression setting is ignored.","triggerScenarios":"file_format=text sink with a compress option whose codec has no case in the switch (e.g. ZSTD, BROTLI, SNAPPY); logged when the first record causes stream creation.","commonSituations":"Copying compress configs from ORC/Parquet jobs; expecting snappy text output; upstream CompressFormat additions missing from TextWriteStrategy.","solutions":["Set compress to gzip, lzo, or none for text sinks (per docs)","Verify supported compress values in the file sink documentation","Use archive compress if you need the file delivered compressed in another way","Extend TextWriteStrategy.getOrCreateOutputStream with the codec if it must be supported"],"exampleFix":"// before\nsink = {\n  file_format = \"text\"\n  compress = \"snappy\"\n}\n// after\nsink = {\n  file_format = \"text\"\n  compress = \"gzip\"\n}","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"none\", \"lzo\", \"gzip\");\nif (!supported.contains(compressValue.toLowerCase())) {\n    throw new IllegalArgumentException(\"text sink supports compress \" + supported + \", got: \" + compressValue);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only text-documented compress codecs","Confirm compression took effect by checking output file names/extensions","Validate configs with a small local run first","Cover every CompressFormat branch in TextWriteStrategy tests"],"tags":["hadoop","file-sink","compression","text"],"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"}