[#10457] improvement: Shrink the package size of Hive Metastore 2 and 3 catalogs#10465
Merged
yuqi1129 merged 8 commits intoapache:mainfrom Mar 25, 2026
Merged
Conversation
…kage size
Reduce the distribution package size of the Hive Metastore 2 and 3
catalog libs by adding dependency exclusions and file-level exclusions
to filter out unnecessary transitive dependencies.
Changes:
- Add dependency-level excludes on `hadoop2.common` and `hive2/3.metastore`
for groups like slf4j, log4j, findbugs, jetty that are either provided
by the server runtime or not needed at runtime
- Add file-level excludes in the `copyLibs` task to filter JARs that
sneak in via other transitive paths:
- Logging: log4j-*.jar, slf4j-*.jar, logback-*.jar
- Test artifacts: junit-*.jar, hamcrest-*.jar, *-tests.jar
- HBase subsystem: hbase-*.jar (not needed for HMS client)
- DataNucleus: datanucleus-*.jar (HMS server-side persistence only)
- Ant build tools: ant-*.jar
- Serialization: avro-*.jar, parquet-hadoop-bundle-*.jar
- Tephra/Twill: tephra-*.jar, twill-*.jar (optional HMS extensions)
- YARN server: hadoop-yarn-server-*.jar
- Annotations: jsr305-*.jar, spotbugs-annotations-*.jar,
findbugs-annotations-*.jar, error_prone_annotations-*.jar, jol-core-*.jar
Result:
- hive-metastore2-libs: 102MB → 78MB (−24MB, −38 JARs)
- hive-metastore3-libs: 127MB → 104MB (−23MB, −4 JARs)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces the distribution package size for Hive Metastore 2 and 3 catalog libraries by excluding unnecessary transitive dependencies and filtering out unneeded JARs during packaging, addressing #10457.
Changes:
- Add dependency-level exclusions to
hadoop2.commonandhive2/3.metastoreto avoid pulling in unwanted transitive artifacts. - Add
copyLibsfile-pattern excludes to prevent specific JARs from being shipped in the distribution packages.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| catalogs/hive-metastore3-libs/build.gradle.kts | Adds dependency exclusions and filters copied JARs to shrink the Hive 3 metastore libs package. |
| catalogs/hive-metastore2-libs/build.gradle.kts | Mirrors the same exclusions/filtering approach for the Hive 2 metastore libs package. |
You can also share your feedback on Copilot code review. Take the survey.
Code Coverage Report
|
…-core dependency to hive-metastore2-libs
…ions and sync comments - Add exclude(group = "com.google.guava") and exclude(group = "ch.qos.logback") at the dependency level for hadoop2.common and hive2/3.metastore in both hive-metastore2-libs and hive-metastore3-libs, consistent with all other excluded groups - Add cross-reference comments noting the exclusion lists are kept in sync between the two modules, and documenting that Guava/Logback are provided by the Gravitino runtime classpath
…ency-level excludes Replace all 19 file-name glob patterns in copyLibs tasks with dependency-level exclude(group = ...) declarations, making the filtering auditable via ./gradlew dependencies and immune to JAR filename changes.
Contributor
…e dependency from hive-metastore-common
Contributor
Author
yuqi1129
reviewed
Mar 20, 2026
Comment on lines
39
to
41
Contributor
There was a problem hiding this comment.
These three can be compiled only
…eOnly in hive-metastore-common These dependencies are provided at runtime by the catalog plugin classloader, so they should be compileOnly to avoid bundling them into the package.
Contributor
|
@diqiu50 CI failed. |
…fix test compilation in hive-metastore-common
Contributor
Author
fixed |
Contributor
Contributor
Author
Contributor
|
I have no more comments, @jerryshao Would you like to take a look? |
yuqi1129
approved these changes
Mar 25, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Mar 25, 2026
… 3 catalogs (#10465) ### What changes were proposed in this pull request? Reduce the distribution package size of Hive Metastore 2 and 3 catalog libs by adding dependency exclusions to filter out unnecessary transitive JARs. | Package | Before | After | |---------|--------|-------| | hive-metastore2-libs | 102MB (176 JARs) | 78MB (138 JARs) | | hive-metastore3-libs | 127MB (205 JARs) | 104MB (201 JARs) | Excluded categories: logging stack (slf4j/log4j/logback), test artifacts (junit/hamcrest), HBase, DataNucleus, Ant, Avro, Parquet, YARN server components, and compile-time annotation JARs. ### Why are the changes needed? Fixes #10457. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit tests and integration tests pass.
diqiu50
added a commit
to diqiu50/gravitino
that referenced
this pull request
Mar 27, 2026
… 2 and 3 catalogs (apache#10465) ### What changes were proposed in this pull request? Reduce the distribution package size of Hive Metastore 2 and 3 catalog libs by adding dependency exclusions to filter out unnecessary transitive JARs. | Package | Before | After | |---------|--------|-------| | hive-metastore2-libs | 102MB (176 JARs) | 78MB (138 JARs) | | hive-metastore3-libs | 127MB (205 JARs) | 104MB (201 JARs) | Excluded categories: logging stack (slf4j/log4j/logback), test artifacts (junit/hamcrest), HBase, DataNucleus, Ant, Avro, Parquet, YARN server components, and compile-time annotation JARs. ### Why are the changes needed? Fixes apache#10457. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit tests and integration tests pass.
danhuawang
pushed a commit
to danhuawang/gravitino
that referenced
this pull request
Mar 30, 2026
… 2 and 3 catalogs (apache#10465) ### What changes were proposed in this pull request? Reduce the distribution package size of Hive Metastore 2 and 3 catalog libs by adding dependency exclusions to filter out unnecessary transitive JARs. | Package | Before | After | |---------|--------|-------| | hive-metastore2-libs | 102MB (176 JARs) | 78MB (138 JARs) | | hive-metastore3-libs | 127MB (205 JARs) | 104MB (201 JARs) | Excluded categories: logging stack (slf4j/log4j/logback), test artifacts (junit/hamcrest), HBase, DataNucleus, Ant, Avro, Parquet, YARN server components, and compile-time annotation JARs. ### Why are the changes needed? Fixes apache#10457. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit tests and integration tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




What changes were proposed in this pull request?
Reduce the distribution package size of Hive Metastore 2 and 3 catalog libs
by adding dependency exclusions to filter out unnecessary transitive JARs.
Excluded categories: logging stack (slf4j/log4j/logback), test artifacts
(junit/hamcrest), HBase, DataNucleus, Ant, Avro, Parquet, YARN server
components, and compile-time annotation JARs.
Why are the changes needed?
Fixes #10457.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Unit tests and integration tests pass.