[WIP][CONNECT] Support directory uploads in Spark Connect copyFromLocalToFs#55904
Open
RaghunandanKumar wants to merge 1 commit into
Open
[WIP][CONNECT] Support directory uploads in Spark Connect copyFromLocalToFs#55904RaghunandanKumar wants to merge 1 commit into
RaghunandanKumar 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 change teaches Spark Connect
SparkSession.copyFromLocalToFsto accept a local directory path in addition to a single file path.Changes in this PR:
forward_to_fsartifacts while preserving the nested relative layoutWhy are the changes needed?
Today the Connect artifact path only accepts a single file for
copyFromLocalToFs, even though PySpark ML Connect has a directory-copy helper and model save flows naturally need to stage directory trees.This leaves two rough edges:
Supporting recursive directory uploads in the Connect artifact path makes the API more generally useful and removes the need for the shallow workaround in ML Connect.
Does this PR introduce any user-facing change?
Yes.
Before this change,
SparkSession.copyFromLocalToFs(local_dir, dest_path)in Spark Connect only supported a single local file path and would not handle a directory tree.After this change, the same API accepts a local directory and copies all files under it recursively while preserving relative paths under the destination.
How was this patch tested?
Added a focused regression test in
pyspark.sql.tests.connect.client.test_artifactcovering nested directory copy.Attempted local verification with:
python/run-tests --testnames pyspark.sql.tests.connect.client.test_artifactbuild/sbt -Phive packageIn this environment, local verification is currently blocked because Spark is not built and the machine does not have a usable Java runtime configured for
build/sbt.Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex GPT-5