Skip to content

[SPARK-59124][CORE][K8S] Support spark.kubernetes.files.avoidDownloadSchemes for K8s Cluster Mode - #58423

Open
WonYong-Jang wants to merge 1 commit into
apache:masterfrom
WonYong-Jang:spark-files-avoid-download
Open

[SPARK-59124][CORE][K8S] Support spark.kubernetes.files.avoidDownloadSchemes for K8s Cluster Mode#58423
WonYong-Jang wants to merge 1 commit into
apache:masterfrom
WonYong-Jang:spark-files-avoid-download

Conversation

@WonYong-Jang

@WonYong-Jang WonYong-Jang commented Aug 31, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

Add a new config spark.kubernetes.files.avoidDownloadSchemes that extends the existing avoidDownload mechanism (SPARK-47475, for jars) to spark.files in Kubernetes cluster mode. When a file's scheme matches (or *), its remote URI is preserved instead of being downloaded to the driver's local disk. This mirrors the jars handling.

Why are the changes needed?

In K8s cluster mode, SparkSubmit always downloads spark.files to the driver and rewrites URIs to file:/tmp/..., discarding the original remote URI (e.g. s3a://). As a result spark.read.* cannot resolve the file on executors, and all files funnel through the driver's file server, saturating its network at high executor counts. Jars already avoid this; files should have the same option.

Does this PR introduce any user-facing change?

Yes - a new opt-in config spark.kubernetes.files.avoidDownloadSchemes (default: none)
No behavior change unless set.

How was this patch tested?

New SparkSubmitSuite tests covering scheme-match(s3a), wildcard (*), and non-match(hdfs) cases.

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

Generated-by: Claude Code (Claude Opus 4.8)

Closes #58310

@WonYong-Jang WonYong-Jang changed the title [WIP][SPARK-59124][CORE][K8S] Support spark.kubernetes.files. avoidDownloadSchemes for K8s cluster mode [SPARK-59124][CORE][K8S] Support spark.kubernetes.files. avoidDownloadSchemes for K8s cluster mode Aug 31, 2026
@WonYong-Jang WonYong-Jang changed the title [SPARK-59124][CORE][K8S] Support spark.kubernetes.files. avoidDownloadSchemes for K8s cluster mode [SPARK-59124][CORE][K8S] Support spark.kubernetes.files.avoidDownloadSchemes for K8s cluster mode Aug 31, 2026
@WonYong-Jang WonYong-Jang changed the title [SPARK-59124][CORE][K8S] Support spark.kubernetes.files.avoidDownloadSchemes for K8s cluster mode [SPARK-59124][CORE][K8S] Support spark.kubernetes.files.avoidDownloadSchemes for K8s Cluster Mode Aug 31, 2026
@WonYong-Jang
WonYong-Jang marked this pull request as ready for review August 31, 2026 03:37
@WonYong-Jang
WonYong-Jang force-pushed the spark-files-avoid-download branch from d79819d to a7f43ce Compare August 31, 2026 03:49
@WonYong-Jang
WonYong-Jang force-pushed the spark-files-avoid-download branch from a7f43ce to 7378ef2 Compare August 31, 2026 03:50
@WonYong-Jang

Copy link
Copy Markdown
Author

@dongjoon-hyun
This extends the same avoidDownloadSchemes option to spark.files, following
SPARK-47475 (jars) and SPARK-55077. Would appreciate a review when you have time.

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.

[K8S] Extend avoidDownloadSchemes to spark.files so executors can read uploaded files directly

1 participant