-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-50166][SQL][BUILD] Fix shade and relocation rule of sql/core module
#48675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| <!-- Guava is relocated to ${spark.shade.packageName}.connect.guava --> | ||
| <exclude>com.google.common.**</exclude> | ||
| </excludes> | ||
| <pattern>com.google.common</pattern> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @pan3793
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the effective relocation rules are very confusing, seems to be affected by parent pom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use combine.self = "override" to resolve this issue.
sql/core module
sql/core modulesql/core module
pan3793
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this.
|
also cc @HyukjinKwon @dongjoon-hyun @HeartSaVioR @bogao007 FYI |
|
Thanks @pan3793 ~ |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the PR description, this is a regression due to SPARK-48755 ?
Thank you for discovering this regression and fixing before Apache Spark 4.0.0 release, @LuciferYang .
|
BTW, to @LuciferYang , we need to wait for SPARK-48755 people as you pinged already. |
Yes |
Got it ~ |
|
Gentle ping once more, @bogao007 and @HeartSaVioR , because the change is reported at #47133 . |
|
I don't have specific concerns as long as the existing CI passes, thanks for fixing this! |
HeartSaVioR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 thanks for the fix!
|
Merged into master for Spark 4.0. Thanks @pan3793 @dongjoon-hyun @HeartSaVioR and @bogao007 ~ |
What changes were proposed in this pull request?
This pr makes the following changes to the
maven-shade-pluginrules for thesql/coremodule:pom.xml, usecombine.self = "override"in the<configuration>of themaven-shade-pluginfor thesql/coremodule. Before this configuration was added, the relocation result was incorrect, andprotobuf-javawas not relocated. We can unzip the packaging result to confirm this issue.We can use IntelliJ's "Show Effective POM" feature to view the result of this parameter, the result is equivalent to the effective POM log with --debug printing added during the Maven compilation:
Before
We can see that an unexpected
has been added to the relocation rule.
After
We can see that the extra
<includes>in the relocation rule is no longer present.Before SPARK-48755 | [SPARK-48755][SS][PYTHON] transformWithState pyspark base implementation and ValueState support #47133 overwrote the
maven-shade-pluginrules forsql/core, it inherited the rules from the parentpom.xmland shadedorg.spark-project.spark:unused. This behavior changed after SPARK-48755, so this pr restores it.The relocation rules for Guava should be retained and follow the configuration in the parent
pom.xml, which relocatescom.google.commonto${spark.shade.packageName}.guava. This PR restores this configuration.For
protobuf-java, which is under thecom.google.protobufpackage, the already shadedprotobuf-javain thecoremodule can be reused instead of shading it again insql/coremodule. Therefore, this pr only configures the corresponding relocation rule for it:com.google.protobuf->${spark.shade.packageName}.spark_core.protobuf.Regarding the
ServicesResourceTransformerconfiguration, it is used to mergeMETA-INF/servicesresources. This is not needed for Guava andprotobuf-java, so this pr removes it.Why are the changes needed?
Fix shade and relocation rule of
sql/coremoduleDoes this PR introduce any user-facing change?
No
How was this patch tested?
spark-sql_2.13-4.0.0-SNAPSHOT.jarto a separate directory, then executegrep "org.sparkproject.guava" -R *andgrep "org.sparkproject.spark_core.protobuf" -R *to confirm the successful relocation.Was this patch authored or co-authored using generative AI tooling?
No