[SPARK-59553][CONNECT] Make SparkSession.addArtifact honor spark.jars.ivySettings - #58874
Open
qianlan717 wants to merge 1 commit into
Open
qianlan717 wants to merge 1 commit into
qianlan717 wants to merge 1 commit into
Conversation
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?
This PR makes SparkSession.addArtifact and SparkSession.addArtifacts honor the existing
spark.jars.ivySettingsSpark configuration when resolvingivy://dependencies.Spark resolves Ivy dependencies through a runtime dependency resolver configured from the driver SparkConf. Spark Connect adds a typed Maven dependency to the ordered artifact batch and resolves it on the server, where the Ivy settings file, repository network, and credentials are available. Support is negotiated through the
serverSideMavenArtifacts.v1capability. A new client falls back to the existing client-side resolution only when the server does not advertise that capability.The server preserves the order of mixed local and Ivy artifacts and resolves the complete batch
before registering it. Server-side resolution rejects repositories supplied through
?repos=, uses an isolated Ivy cache per Spark session, and includes bounded concurrency, connection/read timeouts, an overall deadline, cancellation, quotas, and content-collision checks.Why are the changes needed?
SparkSession.addArtifact currently ignores spark.jars.ivySettings. In Spark Connect, Maven dependencies are also resolved by the client, which often cannot read a server-local Ivy settings file or access the server's Maven network and credentials. As a result, an ivy:// dependency can fail through addArtifact even though the same server configuration works for other Maven dependency surfaces.
Does this PR introduce any user-facing change?
Yes. ivy:// dependencies passed to classic or Connect SparkSession.addArtifact(s) now use spark.jars.ivySettings when configured. Spark Connect resolves them on capable servers. New clients connected to older servers retain the previous client-side resolution behavior.
How was this patch tested?
Added tests covering:
The Python protobuf bindings were regenerated with dev/connect-gen-protos.sh. git diff --check, Scala parser checks, protobuf Java generation, and generated-binding smoke checks passed.
build/sbt common-utils/Test/compile could not run because Maven Central DNS resolution is
unavailable in the current development environment (Could not resolve host: repo1.maven.org).
Was this patch authored or co-authored using generative AI tooling?