You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2025/02/12 15:10:14 UTC
(spark) branch master updated: [SPARK-51163][BUILD] Exclude duplicated jars from connect-repl
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 03868a8e0cc9 [SPARK-51163][BUILD] Exclude duplicated jars from connect-repl
03868a8e0cc9 is described below
commit 03868a8e0cc9416788f1a1ceca6c757b14bdb81e
Author: Cheng Pan <ch...@apache.org>
AuthorDate: Wed Feb 12 07:10:02 2025 -0800
[SPARK-51163][BUILD] Exclude duplicated jars from connect-repl
### What changes were proposed in this pull request?
Currently, the `jars/connect-repl` pulls all transitive deps of `com.lihaoyi:ammonite_2.13:3.0.1`, which have some duplicated deps(e.g. `scala-compiler-2.13.16.jar`) with `jars`.
### Why are the changes needed?
Reduce binary dist tarball size, and avoid potential class conflict issues.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass UT.
```
build/sbt "connect-client-jvm / testOnly *ReplE2ESuite"
```
And additional manual tests.
```
$ diff -r ./connect-repl-master ./connect-repl-SPARK-51163
Only in ./connect-repl-master: java-diff-utils-4.15.jar
Only in ./connect-repl-master: javassist-3.21.0-GA.jar
Only in ./connect-repl-master: jline-3.27.1-jdk8.jar
Only in ./connect-repl-master: jline-reader-3.14.1.jar
Only in ./connect-repl-master: jline-terminal-3.14.1.jar
Only in ./connect-repl-master: jline-terminal-jna-3.14.1.jar
Only in ./connect-repl-master: jna-5.3.1.jar
Only in ./connect-repl-master: scala-collection-compat_2.13-2.12.0.jar
Only in ./connect-repl-master: scala-compiler-2.13.16.jar
Only in ./connect-repl-master: scala-xml_2.13-2.3.0.jar
Binary files ./connect-repl-master/spark-connect-client-jvm_2.13-4.1.0-SNAPSHOT.jar and ./connect-repl-SPARK-51163/spark-connect-client-jvm_2.13-4.1.0-SNAPSHOT.jar differ
```
Package binary dist, and run `spark-shell` to connect a Connect Server(4.0.0-preview2)
```
$ bin/spark-shell --remote sc://localhost:15002
WARNING: Using incubator modules: jdk.incubator.vector
25/02/12 13:58:42 INFO BaseAllocator: Debug mode disabled. Enable with the VM option -Darrow.memory.debug.allocator=true.
25/02/12 13:58:42 INFO DefaultAllocationManagerOption: allocation manager type not specified, using netty as the default type
25/02/12 13:58:42 INFO CheckAllocator: Using DefaultAllocationManager at memory/netty/DefaultAllocationManagerFactory.class
Compiling (synthetic)/ammonite/predef/ArgsPredef.sc
Compiling /Users/chengpan/Projects/apache-spark/dist/(console)
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 4.1.0-SNAPSHOT
/_/
Type in expressions to have them evaluated.
Spark connect server version 4.0.0-preview2.
Spark session available as 'spark'.
scala> spark.range(10).show
Using Spark's default log4j profile: org/apache/spark/log4j2-defaults.properties
+---+
| id|
+---+
| 0|
| 1|
| 2|
| 3|
| 4|
| 5|
| 6|
| 7|
| 8|
| 9|
+---+
scala>
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #49892 from pan3793/SPARK-51163.
Authored-by: Cheng Pan <ch...@apache.org>
Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
sql/connect/client/jvm/pom.xml | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/sql/connect/client/jvm/pom.xml b/sql/connect/client/jvm/pom.xml
index 55a2125ba28b..81e195fb5ccd 100644
--- a/sql/connect/client/jvm/pom.xml
+++ b/sql/connect/client/jvm/pom.xml
@@ -55,6 +55,16 @@
<artifactId>spark-sketch_${scala.binary.version}</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-compiler</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.scala-lang.modules</groupId>
+ <artifactId>scala-xml_${scala.binary.version}</artifactId>
+ <scope>compile</scope>
+ </dependency>
<!--
We need to define protobuf here because we need to change the scope of both from
provided to compile. If we don't do this we can't shade these libraries.
@@ -80,6 +90,15 @@
<groupId>com.lihaoyi</groupId>
<artifactId>ammonite_${scala.version}</artifactId>
<version>${ammonite.version}</version>
+ <exclusions>
+ <!--
+ Exclude fine-grained jline jars and in favor the bundled jline jar pulled by scala-compiler.
+ -->
+ <exclusion>
+ <groupId>org.jline</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
<scope>provided</scope>
</dependency>
<dependency>
@@ -208,7 +227,7 @@
</plugin>
<plugin>
<!--
- Here we download Spark Connect cleint dependencies for REPL and copy
+ Here we download Spark Connect client dependencies for REPL and copy
Spark Connect client to target's jars/connect-repl directory (at assembly/pom.xml).
Those jars will only be loaded when we run Spark Connect shell, see also SPARK-49198
-->
@@ -224,6 +243,7 @@
<configuration>
<outputDirectory>${basedir}/target/connect-repl</outputDirectory>
<includeScope>provided</includeScope>
+ <excludeArtifactIds>scala-collection-compat_${scala.binary.version},javassist</excludeArtifactIds>
</configuration>
</execution>
</executions>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org