apache/seatunnel · warning

Json file does not support this compress type

Error message

Json file does not support this compress type: {}

What it means

Warning logged in JsonReadStrategy.readProcess's switch over CompressFormat when the configured compress_codec has no supported case for JSON reading. The compressed stream is passed through un-decompressed, so JSON parsing downstream will typically fail or produce corrupt rows.

Solutions

  1. Change compress_codec to a supported value (none/gzip/bzip2/lz4/lzo) per JSON reader docs.
  2. Pre-decompress files and read with compress_codec = none.
  3. Convert files to a format whose reader supports the desired codec.
  4. Verify the exact spelling and allowed values of compress_codec.

Example fix

// before
compress_codec = "zip"
// after
compress_codec = "gzip"
Defensive patterns

Strategy: validation

Validate before calling

Set<String> jsonSupported = Set.of("none","gzip","bzip2","lz4","lzo");
if (!jsonSupported.contains(config.getString("compress_codec"))) {
    throw new IllegalArgumentException("compress_codec not supported by JSON reader");
}

Prevention

When it happens

Trigger: compress_codec config value maps to a CompressFormat enum not handled by the JSON reader's switch (only codecs like LZO/LZ4/GZIP/BZIP2/NONE are handled); default branch logs and uses the raw stream.

Common situations: Using a codec supported by other file readers but not the JSON path; copy-pasted config from another connector; typo in compress_codec producing an unexpected default.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/JsonReadStrategy.java:110

    @Override
    public void readProcess(
            FileSourceSplit split,
            Collector<SeaTunnelRow> output,
            InputStream inputStream,
            Map<String, String> partitionsMap,
            String currentFileName)
            throws IOException {
        InputStream actualInputStream;
        switch (compressFormat) {
            case LZO:
                LzopCodec lzo = new LzopCodec();
                actualInputStream = lzo.createInputStream(inputStream);
                break;
            case NONE:
                actualInputStream = inputStream;
                break;
            default:
                log.warn(
                        "Json file does not support this compress type: {}",
                        compressFormat.getCompressCodec());
                actualInputStream = inputStream;
                break;
        }
        // rebuild inputStream
        if (enableSplitFile && split.getLength() > -1) {
            actualInputStream = safeSlice(actualInputStream, split.getStart(), split.getLength());
        }
        try (BufferedReader reader = createBomAwareBufferedReader(actualInputStream, encoding)) {
            reader.lines()
                    .forEach(
                            line -> {
                                try {
                                    SeaTunnelRow seaTunnelRow =
                                            deserializationSchema.deserialize(
                                                    line.getBytes(StandardCharsets.UTF_8));
                                    if (isMergePartition) {

View on GitHub (pinned to cf67b549a7)