{"record":{"id":"ab81aab8fd6aa313","repo":"prestodb/presto","slug":"invalid-compressed-stream-ab81aa","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/OrcZstdDecompressor.java","lineNumber":57,"sourceCode":"            this.decompressor = new ZstdDecompressor();\n        }\n    }\n\n    @Override\n    public int decompress(byte[] input, int offset, int length, OutputBuffer output)\n            throws OrcCorruptionException\n    {\n        try {\n            long uncompressedLength = ZstdDecompressor.getDecompressedSize(input, offset, length);\n            if (uncompressedLength > maxBufferSize) {\n                throw new OrcCorruptionException(orcDataSourceId, \"Zstd requires buffer (%s) larger than max size (%s)\", uncompressedLength, maxBufferSize);\n            }\n\n            byte[] buffer = output.initialize(toIntExact(uncompressedLength));\n            return decompressor.decompress(input, offset, length, buffer, 0, buffer.length);\n        }\n        catch (MalformedInputException e) {\n            throw new OrcCorruptionException(e, orcDataSourceId, \"Invalid compressed stream\");\n        }\n    }\n\n    @Override\n    public String toString()\n    {\n        return \"zstd\";\n    }\n}\n","sourceCodeStart":39,"sourceCodeEnd":67,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/OrcZstdDecompressor.java#L39-L67","documentation":"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.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcZstdDecompressor.java:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify file integrity and re-obtain the original data","Check that the file's compression kind actually matches its streams","Report persistent corruption to storage owners"],"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"}