[SPARK-56374][BUILD] Align SBT assembly shade rules with Maven#55306
Closed
yadavay-amzn wants to merge 1 commit intoapache:masterfrom
Closed
[SPARK-56374][BUILD] Align SBT assembly shade rules with Maven#55306yadavay-amzn wants to merge 1 commit intoapache:masterfrom
yadavay-amzn wants to merge 1 commit intoapache:masterfrom
Conversation
49bfad3 to
3dafde2
Compare
Add missing shade rules to SparkBuild.scala for three connect modules: 1. SparkConnect (server): Add guava and guava.thirdparty relocations to match Maven. Without these, grpc classes in the assembly reference unshaded com.google.common.* which fails at runtime since Guava is shaded to org.sparkproject.guava in spark-network-common. 2. SparkConnectClient (jvm): Add org.apache.arrow relocation to match Maven. Arrow classes are now shaded under org/sparkproject/connect/client/org/apache/arrow/. 3. SparkConnectJdbc: Add org.apache.arrow relocation for consistency with Maven and the jvm client module. Closes SPARK-56374
3dafde2 to
2254ce1
Compare
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?
Add missing shade rules to
project/SparkBuild.scalato align SBT assembly output with Maven for three connect modules:SparkConnect (server): Add
com.google.common→org.sparkproject.guavaandcom.google.thirdparty→org.sparkproject.guava.thirdpartyrelocations. Maven'ssql/connect/server/pom.xmlhas these but SBT was missing them.SparkConnectClient (jvm): Add
org.apache.arrow→org.sparkproject.connect.client.org.apache.arrowrelocation. Maven'sconnector/connect/client/jvm/pom.xmlhas this but SBT was missing it.SparkConnectJdbc: Add
org.apache.arrowrelocation for consistency with Maven'ssql/connect/client/jdbc/pom.xml.Why are the changes needed?
SBT assembly shade rules were out of sync with Maven, causing differences in the assembled JARs:
Server: Without the guava relocation, grpc classes in the server assembly reference unshaded
com.google.common.*. At runtime these fail to resolve because Guava is shaded toorg.sparkproject.guavainspark-network-common. Verified by inspectingManagedChannelImpl.class— after the fix, references correctly point toorg/sparkproject/guava/base/MoreObjectsinstead ofcom/google/common/base/MoreObjects.Client JVM: Arrow classes were not being shaded. After the fix, they appear under
org/sparkproject/connect/client/org/apache/arrow/.Other Maven modules with shade rules (
core,sql/core,network-yarn, rootpom.xml) were verified to be intentionally different in SBT — those modules don't produce separate assembly JARs in SBT, and their shading is handled at a different level in the SBT build architecture.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Built all three affected SBT assemblies and verified the output JARs:
Verified shading in the output JARs:
strings ManagedChannelImpl.classshowsorg/sparkproject/guava/base/MoreObjects(wascom/google/common/base/MoreObjectsbefore fix)jar tfshows arrow classes underorg/sparkproject/connect/client/org/apache/arrow/with zero unshadedorg/apache/arrowentriesWas this patch authored or co-authored using generative AI tooling?
Yes