prestodb/presto · error · OrcCompressionVerificationException
Write-side compression verification failed: %s (uncompressed
Error message
Write-side compression verification failed: %s (uncompressedSize=%s compressedSize=%s)
What it means
verifyCompressedChunk decompresses each freshly written chunk and wraps any RuntimeException from the decompressor (ZstdException, MalformedInputException, etc.) into OrcCompressionVerificationException. This means data the writer just compressed could not be decoded back, so the written file would be corrupt.
Source
Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcOutputBuffer.java:631
Decompressor verifyDecompressor,
CompressionBufferPool decompressionBufferPool,
byte[] original,
int offset,
int length,
byte[] compressed,
int compressedLength)
{
byte[] decompressed = decompressionBufferPool.checkOut(length);
try {
int decompressedLength;
try {
decompressedLength = verifyDecompressor.decompress(compressed, 0, compressedLength, decompressed, 0, length);
}
catch (RuntimeException e) {
// Any decode failure (ZstdException, MalformedInputException, ...) means the
// freshly compressed chunk is not decodable. Chain the cause so the original
// decoder stack trace is preserved.
throw new OrcCompressionVerificationException(
e,
"Write-side compression verification failed: %s (uncompressedSize=%s compressedSize=%s)",
e.getMessage(),
length,
compressedLength);
}
if (decompressedLength != length || !Arrays.equals(decompressed, 0, length, original, offset, offset + length)) {
throw new OrcCompressionVerificationException(
"Write-side compression verification failed: chunk does not decode back to the original bytes (uncompressedSize=%s compressedSize=%s decompressedSize=%s)",
length,
compressedLength,
decompressedLength);
}
}
finally {
decompressionBufferPool.checkIn(decompressed);
}
}View on GitHub (pinned to 55bb57d202)
Solutions
- Inspect the chained cause (getCause) to identify the failing codec
- Verify the native/JNI codec library version and integrity (e.g. zstd-jni)
- Disable write-side compression verification if it is not required for your workload
- Downgrade/upgrade the codec library to a known-good version
Defensive patterns
Strategy: try-catch
Validate before calling
// pre-check codec availability before writing
try (OrcWriter w = OrcWriter.builder().setCompressionKind(kind).build()) { /* ... */ } Try / catch
try { orcWriter.write(page); }
catch (OrcCompressionVerificationException e) {
LOG.error("Codec round-trip failure", e.getCause());
throw new IOException("Write aborted: corrupt chunk", e);
} Prevention
- Keep zstd-jni / aircompressor native libs up to date
- Run write-verification in staging with production codecs
- Avoid unverified custom Decompressor implementations
When it happens
Trigger: During writeChunkToOutputStream, the verify decompressor throws while decoding a just-compressed chunk (decoder failure on the compressed bytes).
Common situations: Faulty JNI/native codec libraries (e.g. broken Zstd JNI), buffer/offset bugs in custom decompressors, memory corruption, or incompatible codec implementations.
Related errors
- Write-side compression verification failed: chunk does not d
- NOT_SUPPORTED
- Unsupported compression for verification:
- Write validation failed:
- compression not implemented yet
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/36279ac047b16262.
Report an issue: GitHub.