prestodb/presto · error · OrcCorruptionException

Invalid compressed stream

Error message

Invalid compressed stream

What it means

Zlib decompression error in OrcZlibDecompressor: the inflater threw DataFormatException (or produced needsInput/finished inconsistencies), meaning the compressed bytes are not a valid deflate stream. Reported as 'Invalid compressed stream' — classic symptom of a corrupted or non-ORC file region.

Source

Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcZlibDecompressor.java:64

                uncompressedLength += inflater.inflate(buffer, uncompressedLength, buffer.length - uncompressedLength);
                if (inflater.finished() || buffer.length >= maxBufferSize) {
                    break;
                }
                int oldBufferSize = buffer.length;
                buffer = output.grow(Math.min(buffer.length * 2, maxBufferSize));
                if (buffer.length <= oldBufferSize) {
                    throw new IllegalStateException(String.format("Buffer failed to grow. Old size %d, current size %d", oldBufferSize, buffer.length));
                }
            }

            if (!inflater.finished()) {
                throw new OrcCorruptionException(orcDataSourceId, "Could not decompress all input (output buffer too small?)");
            }

            return uncompressedLength;
        }
        catch (DataFormatException e) {
            throw new OrcCorruptionException(e, orcDataSourceId, "Invalid compressed stream");
        }
        finally {
            inflater.end();
        }
    }

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

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the file for corruption (checksums, re-copy from source)
  2. Confirm the file is actually ORC/zlib-compressed as its postscript claims
  3. Report file-level corruption to the storage owner
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcZlibDecompressor.java:64 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/ceec307d5749ab17. Report an issue: GitHub.