{"record":{"id":"ceec307d5749ab17","repo":"prestodb/presto","slug":"invalid-compressed-stream-ceec30","errorCode":null,"errorMessage":"Invalid compressed stream","messagePattern":"Invalid compressed stream","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/OrcZlibDecompressor.java","lineNumber":64,"sourceCode":"                uncompressedLength += inflater.inflate(buffer, uncompressedLength, buffer.length - uncompressedLength);\n                if (inflater.finished() || buffer.length >= maxBufferSize) {\n                    break;\n                }\n                int oldBufferSize = buffer.length;\n                buffer = output.grow(Math.min(buffer.length * 2, maxBufferSize));\n                if (buffer.length <= oldBufferSize) {\n                    throw new IllegalStateException(String.format(\"Buffer failed to grow. Old size %d, current size %d\", oldBufferSize, buffer.length));\n                }\n            }\n\n            if (!inflater.finished()) {\n                throw new OrcCorruptionException(orcDataSourceId, \"Could not decompress all input (output buffer too small?)\");\n            }\n\n            return uncompressedLength;\n        }\n        catch (DataFormatException e) {\n            throw new OrcCorruptionException(e, orcDataSourceId, \"Invalid compressed stream\");\n        }\n        finally {\n            inflater.end();\n        }\n    }\n\n    @Override\n    public String toString()\n    {\n        return \"zlib\";\n    }\n}\n","sourceCodeStart":46,"sourceCodeEnd":77,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/OrcZlibDecompressor.java#L46-L77","documentation":"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.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcZlibDecompressor.java:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the file for corruption (checksums, re-copy from source)","Confirm the file is actually ORC/zlib-compressed as its postscript claims","Report file-level corruption to the storage owner"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}