Repository navigation
Relocate org.apache.datasketches in beam-sdks-java-harness - #166
Merged
Merged
Conversation
yananhao12
approved these changes
May 5, 2026
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.
Problem
beam-sdks-java-harnessbundled ~70 unrelocatedorg.apache.datasketches.memory.*classes frozen at v2.0.0 with no shade relocation. These conflict withdatasketches-memory:3.0.2pulled intransitively via
datasketches-java:3.0.0in consumer MPs, causing linkage checker "missing method" errors.Root cause:
BaseWritableMemoryImplin v2.0.0 extendsBaseStateImpl(noAutoCloseable), but in v3.0.2 it extendsResourceImpl implements Resource(addsclose()). Both versions share the sameFQCNs, causing binary incompatibility.
Fix
Add a shade relocation rule in
sdks/java/harness/build.gradleto relocateorg.apache.datasketchestoorg.apache.beam.repackaged.harness.org.apache.datasketches, following the same pattern alreadyused in
sdks/java/coreforcommons-compress,commons-lang3, andantlr.Verification
Before fix — ~70 unrelocated classes visible:
jar tf beam-sdks-java-harness-2.45.54-SNAPSHOT.jar | grep '^org/apache/datasketches/memory/'returns ~70 classes
After fix — no unrelocated classes, all relocated to shaded path:
jar tf beam-sdks-java-harness-2.45.55-SNAPSHOT.jar | grep '^org/apache/datasketches/memory/'returns nothing
jar tf beam-sdks-java-harness-2.45.55-SNAPSHOT.jar | grep 'datasketches'returns org/apache/beam/repackaged/harness/org/apache/datasketches/...
Changes
sdks/java/harness/build.gradle: add relocation rule fororg.apache.datasketchesbuildSrc/.../BeamModulePlugin.groovy: bump version to2.45.55gradle.properties: bump version to2.45.55