Skip to content

[SPARK-58531][SQL][CONNECT] Make spark.sql.artifact.copyFromLocalToFs.allowDestLocal a static conf - #57730

Open
haoyangeng-db wants to merge 1 commit into
apache:masterfrom
haoyangeng-db:sec-23675-remove-artifact-allowdestlocal-conf
Open

[SPARK-58531][SQL][CONNECT] Make spark.sql.artifact.copyFromLocalToFs.allowDestLocal a static conf#57730
haoyangeng-db wants to merge 1 commit into
apache:masterfrom
haoyangeng-db:sec-23675-remove-artifact-allowdestlocal-conf

Conversation

@haoyangeng-db

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Completes the Spark 4.0 migration of the copyFromLocalToFs local-destination gate: spark.sql.artifact.copyFromLocalToFs.allowDestLocal becomes a static SQL conf and the deprecated spark.connect.copyFromLocalToFs.allowDestLocal is removed, leaving one conf for the gate.

Why are the changes needed?

The config controls whether a caller can write to an arbitrary path on the driver's local filesystem, so it is meant to be set by whoever starts the driver -- as its own doc says, "when starting spark driver". The deprecated Connect conf was a static conf and enforced that, but its replacement was declared as a runtime conf, so a session could set it and override the value the driver was started with. Declaring the replacement in StaticSQLConf restores that property.

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

New and existing tests.

Was this patch authored or co-authored using generative AI tooling?

Co-authored by Claude Code

….allowDestLocal a static conf and remove the deprecated spark.connect.copyFromLocalToFs.allowDestLocal

Completes the Spark 4.0 migration of the `copyFromLocalToFs` local-destination gate:
`spark.sql.artifact.copyFromLocalToFs.allowDestLocal` becomes a static SQL conf and the
deprecated `spark.connect.copyFromLocalToFs.allowDestLocal` is removed, leaving one conf
for the gate.

The gate controls whether a caller can write to an arbitrary path on the driver's local
filesystem, so it is meant to be set by whoever starts the driver -- as its own doc says,
"when starting spark driver". The deprecated Connect conf was a static conf and enforced
that, but its replacement was declared as a runtime conf, so a session could set it and
override the value the driver was started with. Declaring the replacement in StaticSQLConf
restores that property.

Co-authored-by: Isaac

@cloud-fan cloud-fan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 blocking, 0 non-blocking, 0 nits.
The configuration lifecycle, enforcement path, migration cleanup, and focused regression coverage are internally consistent.

Verification

I traced static-config registration through SQLConf.buildStaticConf, the SparkConf-to-session initialization path, and the ArtifactManager local-filesystem branch. I also verified that the replacement remains default-disabled, the enabled suite path is configured before session creation, and the new test rejects session mutation. Tests were not run as part of this review.

@uros-b

uros-b commented Aug 4, 2026

Copy link
Copy Markdown
Member

LGTM, thank you @haoyangeng-db and @HyukjinKwon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants