apache / apache/paimon

[Bug] file format is orc use zstd occur: ZstdException: Data corruption detected

Open
#5,045 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.

### Paimon version

detail:
```
Caused by: com.github.luben.zstd.ZstdException: Data corruption detected
at com.github.luben.zstd.ZstdDecompressCtx.decompressByteArray(ZstdDecompressCtx.java:205)
at com.github.luben.zstd.Zstd.decompressByteArray(Zstd.java:439)
at org.apache.paimon.shade.org.apache.orc.impl.ZstdCodec.decompress(ZstdCodec.java:259)
at org.apache.paimon.shade.org.apache.orc.impl.InStream$CompressedStream.readHeader(InStream.java:521)
at org.apache.paimon.shade.org.apache.orc.impl.InStream$CompressedStream.ensureUncompressed(InStream.java:548)
at org.apache.paimon.shade.org.apache.orc.impl.InStream$CompressedStream.read(InStream.java:535)
at org.apache.paimon.shade.org.apache.orc.impl.TreeReaderFactory$BytesColumnVectorUtil.commonReadByteArrays(TreeReaderFactory.java:2060)
at org.apache.paimon.shade.org.apache.orc.impl.TreeReaderFactory$BytesColumnVectorUtil.readOrcByteArrays(TreeReaderFactory.java:2079)
at org.apache.paimon.shade.org.apache.orc.impl.TreeReaderFactory$StringDirectTreeReader.nextVector(TreeReaderFactory.java:2177)
at org.apache.paimon.shade.org.apache.orc.impl.TreeReaderFactory$StringTreeReader.nextVector(TreeReaderFactory.java:2009)
at org.apache.paimon.shade.org.apache.orc.impl.TreeReaderFactory$StructTreeReader.nextVector(TreeReaderFactory.java:2633)
at org.apache.paimon.shade.org.apache.orc.impl.reader.tree.StructBatchReader.readBatchColumn(StructBatchReader.java:65)
at org.apache.paimon.shade.org.apache.orc.impl.reader.tree.StructBatchReader.nextBatchForLevel(StructBatchReader.java:100)
at org.apache.paimon.shade.org.apache.orc.impl.reader.tree.StructBatchReader.nextBatch(StructBatchReader.java:77)
at org.apache.paimon.shade.org.apache.orc.impl.RecordReaderImpl.nextBatch(RecordReaderImpl.java:1579)
at org.apache.paimon.format.orc.OrcReaderFactory.nextBatch(OrcReaderFactory.java:322)
at org.apache.paimon.format.orc.OrcReaderFactory.access$100(OrcReaderFactory.java:66)
at org.apache.paimon.format.orc.OrcReaderFactory$OrcVectorizedReader.readBatch(OrcReaderFactory.java:235)
at org.apache.paimon.format.orc.OrcReaderFactory$OrcVectorizedReader.readBatch(OrcReaderFactory.java:217)
at org.apache.paimon.reader.RecordReaderIterator.(RecordReaderIterator.java:37)
```

### Compute Engine

Flink

### Minimal reproduce step

Current we don't know how reproduce this problem. Read the file find the problem is in header.

### What doesn't meet your expectations?

If anyone meet this problem could give more context.

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with org.apache.paimon.format.orc.OrcReaderFactory and the shaded ORC ZstdCodec/InStream stack shown in the report. Try to obtain a reproducible ORC file and trace the failing header through the reader path. Done means identifying a confirmed cause and providing a regression test or documented reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.