prestodb/presto · error · OrcCorruptionException

Invalid compressed stream

Error message

Invalid compressed stream

What it means

Zstd decompression error in OrcZstdDecompressor.decompress: the zstd library threw while decompressing the stream, reported as 'Invalid compressed stream'. The compressed bytes in the ORC file are not a decodable zstd block — corruption, truncation, or a compression-kind mismatch in the file's metadata.

Source

Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcZstdDecompressor.java:57

            this.decompressor = new ZstdDecompressor();
        }
    }

    @Override
    public int decompress(byte[] input, int offset, int length, OutputBuffer output)
            throws OrcCorruptionException
    {
        try {
            long uncompressedLength = ZstdDecompressor.getDecompressedSize(input, offset, length);
            if (uncompressedLength > maxBufferSize) {
                throw new OrcCorruptionException(orcDataSourceId, "Zstd requires buffer (%s) larger than max size (%s)", uncompressedLength, maxBufferSize);
            }

            byte[] buffer = output.initialize(toIntExact(uncompressedLength));
            return decompressor.decompress(input, offset, length, buffer, 0, buffer.length);
        }
        catch (MalformedInputException e) {
            throw new OrcCorruptionException(e, orcDataSourceId, "Invalid compressed stream");
        }
    }

    @Override
    public String toString()
    {
        return "zstd";
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify file integrity and re-obtain the original data
  2. Check that the file's compression kind actually matches its streams
  3. Report persistent corruption to storage owners
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcZstdDecompressor.java:57 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/ab81aab8fd6aa313. Report an issue: GitHub.