You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/04/02 16:22:00 UTC

[jira] [Commented] (HADOOP-19855) Use zstd-jni in ZStandardCodec

    [ https://issues.apache.org/jira/browse/HADOOP-19855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18070641#comment-18070641 ] 

ASF GitHub Bot commented on HADOOP-19855:
-----------------------------------------

pan3793 opened a new pull request, #8399:
URL: https://github.com/apache/hadoop/pull/8399

   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 'HADOOP-17799. Your PR title ...'.
   -->
   
   ### Description of PR
   
   Replaces Hadoop's custom native C bindings for ZStandard compression (`ZStandardCompressor.c`, `ZStandardDecompressor.c`) with the `com.github.luben:zstd-jni` JVM library. This eliminates the requirement to build or install libzstd natively, making ZStandard compression available on all platforms without a native build.
   
   `zstd-jni` is the de facto choice for JVM applications to the zStandard compression algorithm, it was adopted by many projects - Parquet, Spark, Avro, Kafka, HBase, ElasticSearch, etc.
   
   It's relatively painful to set up / upgrade native libraries on each Hadoop client and node, downstream projects like Parquet/Spark/HBase used to choose to implement their own zstd codec to overcome such a challenge, resulting in a lot of repetitive work.
   
   ### How was this patch tested?
   
   Pass all existing UTs:
   - TestZStandardCompressorDecompressor
   - TestCodec
   - TestCompressionStreamReuse
   
   Will do more manual tests and update results here.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id (HADOOP-19855)?
   - [ ] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files?
   
   ### AI Tooling
   
   This PR contains content generated by Claude Code (Sonnet 4.6).
   
   - [x] The PR includes the phrase "Contains content generated by <tool>"
         where <tool> is the name of the AI tool used.
   - [x] My use of AI contributions follows the ASF legal policy
         https://www.apache.org/legal/generative-tooling.html




> Use zstd-jni in ZStandardCodec
> ------------------------------
>
>                 Key: HADOOP-19855
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19855
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: compress
>    Affects Versions: 3.5.0
>            Reporter: Cheng Pan
>            Priority: Major
>
> In Hadoop, we use native libs for zstd codec which has several disadvantages:
>  * It requires native *libhadoop* and *libzstd* to be installed in system {*}LD_LIBRARY_PATH{*}, and they have to be installed separately on each node of the clusters, container images, or local test environments which adds huge complexities from deployment point of view. In some environments, it requires compiling the natives from sources which is non-trivial. Also, this approach is platform dependent; the binary may not work in different platform, so it requires recompilation.
>  * It requires extra configuration of *java.library.path* to load the natives, and it results higher application deployment and maintenance cost for users.
> Projects such as *Spark* and *Parquet* use [zstd-jni|https://github.com/luben/zstd-jni] which is JNI-based implementation. It contains native binaries for Linux, Mac, and IBM in jar file, and it can automatically load the native binaries into JVM from jar without any setup.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org