Skip to content

[core] Optimize ZSTD block decompression - #8865

Merged
JingsongLi merged 1 commit into
apache:masterfrom
JingsongLi:codex/optimize-zstd-decompression
Jul 28, 2026
Merged

[core] Optimize ZSTD block decompression#8865
JingsongLi merged 1 commit into
apache:masterfrom
JingsongLi:codex/optimize-zstd-decompression

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

What changed

  • Replace ZstdInputStream and ByteArrayInputStream with zstd-jni's direct byte-array decompression API.
  • Preserve source and destination offsets and translate zstd failures to BufferDecompressionException.

Why

Block decompression is a hot path for compressed local lookup data. The stream-based implementation allocates wrapper objects and repeatedly calls read; the direct API decompresses the complete block into the caller-provided buffer in one native call.

Validation

  • mvn -q -pl paimon-common -Pfast-build -DwildcardSuites=none -Dtest=BlockCompressionTest test
  • mvn -q -pl paimon-common spotless:check -DskipTests
  • mvn -q -pl paimon-common -DskipTests compile

@JingsongLi
JingsongLi marked this pull request as ready for review July 27, 2026 15:52

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I verified the direct decompression path preserves source/destination offsets and translates zstd failures correctly. BlockCompressionTest passes locally.

@JingsongLi
JingsongLi merged commit 6695d6c into apache:master Jul 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants