[896] Shrink the xtable-utilities bundled jar from 1.1 GB to 423 MB - #897
[896] Shrink the xtable-utilities bundled jar from 1.1 GB to 423 MB#897slachiewicz wants to merge 4 commits into
Conversation
xtable-utilities depended on software.amazon.awssdk:bundle, the all-services jar. It was 1957 MB of the 3094 MB shaded jar, across 379410 files. hadoop-aws 3.4.1 S3A references only services/s3, plus STSClient for assumed roles, and the transfer, http, core, awscore and auth packages. No other AWS service appears anywhere in its 418 classes. So: s3, sts, netty-nio-client and s3-transfer-manager. Glue keeps coming granularly via xtable-aws. The root pom now imports the AWS BOM instead of managing artifacts one by one. Bundled jar 1098 MB -> 473 MB, 582980 entries -> 212508. Not verified against a live S3 endpoint. A credentials provider or signer configured by class name could still reach outside this set.
ppc64le, s390x and 32-bit Linux, 84 MB across six files. x86_64 and aarch64 keep their musl builds, macOS and Windows stay for development. The excludes go in the root pom's shade execution, not the module: an execution-level <filters> replaces a plugin-level one rather than merging with it, so a filter added in the module is silently dropped. Bundled jar 473 MB -> 443 MB.
grpc-xds is only reachable through xds:// targets, which nothing here uses; its 40 MB is referenced only by gRPC's own code. groovy-all 2.4.11 arrives via Hive and nothing outside Groovy touches it. Bundled jar 443 MB -> 423 MB.
arns, aws-query-protocol, aws-xml-protocol and crt-core were in the old bundle but not in the shade includes, so the S3 and STS clients would have failed at runtime. Found with jdeps; the earlier constant-pool scan only covered what S3A names directly, not what those classes need. hadoop-aws also brings bundle 2.24.6 transitively, which the direct 2.29.40 declaration had been masking. Excluded so it cannot return.
|
Also: After the fix the package counts match the original bundle exactly — One thing The live S3 run is still worth doing before merge. This comment was created with AI assistance. |
|
Tested this against live S3, live ADLS Gen2 and live GCS. No regression found. Differential: baseline jar at ef88e02 (the commit under this PR) versus this PR's jar, identical Sizes confirm the table in the description exactly: baseline 1,097,347,589 bytes, this PR ServiceLoader diff — the #736 failure shape. 131 of 137 service files are byte-identical. No AWS SDK registration was lost. AWS, real bucket:
Azure, real ADLS Gen2 with hierarchical namespace, through the shipped GCS, real bucket, service-account JSON: RunSync DELTA→ICEBERG over Re-tested rebased onto #906The first pass needed a workaround: the bundled jar cannot read Delta sources at all, because I rebased this branch onto #906 and re-ran everything with no workaround. Clean rebase, no One interaction worth flagging for reviewers. With #906 merging service files, this PR's What this does not settleThe gap in the description is narrowed, not closed. Three credential providers named by class Also untested: Hudi in either direction, This comment was created with AI assistance. |
Closes #896.
What is the purpose of the pull request
xtable-utilitiesbuilds a 1.1 GB bundled jar from 795 lines of Java. This cuts it to 423 MB without touching any source.Brief change log
software.amazon.awssdk:bundle, the all-services jar, with the four artifactshadoop-awsS3A actually uses:s3,sts,netty-nio-client,s3-transfer-manager. The AWS SDK goes from 1957 MB to 50 MB uncompressed.io.grpc:grpc-xds(40 MB) andorg.codehaus.groovy:groovy-all(9.5 MB) from the shade whitelist.One detail worth flagging for reviewers: the RocksDB excludes had to go in the root pom's shade execution, not the module's plugin configuration. An execution-level
<filters>replaces a plugin-level one instead of merging, so a filter added in the module is silently ignored — the build passes and nothing is filtered.Verify this pull request
The AWS reduction was derived rather than guessed: I scanned the constant pools of all 418
org.apache.hadoop.fs.s3aclasses inhadoop-aws3.4.1. They reference exactly one AWS service package,services/s3, plusSTSClientand thetransfer,http,core,awscoreandauthpackages. No other AWS service appears.This has not been run against live S3, Azure or GCS. Static analysis cannot see a credentials provider or signer named by class in configuration, so a deployment setting
fs.s3a.aws.credentials.providerto an AWS SDK class directly could still hitNoClassDefFoundError— the same failure mode as #736. I would like someone to runRunSyncagainst a real bucket before this merges.Builds green on Temurin 11;
spotless:checkclean.This change was created with AI assistance.