HyukjinKwon commented on code in PR #41357:
URL: https://github.com/apache/spark/pull/41357#discussion_r1220735232
##########
python/pyspark/sql/connect/session.py:
##########
@@ -637,6 +638,34 @@ def addArtifacts(self, *path: str, pyfile: bool = False,
archive: bool = False)
addArtifact = addArtifacts
+ def copyFromLocalToFs(self, local_path: str, dest_path: str) -> None:
+ """
+ Copy file from local to cloud storage file system.
+ If the file already exits in destination path, old file is overwritten.
+
+ Parameters
+ ----------
+ local_path: str
+ Path to a local file (Directory is not supported yet).
+ The path can be either an absolute path or a relative path.
+
+ dest_path: str
+ The cloud storage path to the destination the file will
+ be copied to.
+ The path must be an an absolute path.
+
+ Notes
+ -----
+ This API is a developer API.
+ """
+ if urllib.parse.urlparse(dest_path).scheme:
+ raise ValueError(
+ "`spark_session.copyFromLocalToFs` API only allows `dest_path`
to be a path "
+ "without scheme, and spark driver uses the default scheme to "
+ "determine the destination file system."
Review Comment:
Why can't we support the fully qualified URI with the scheme? We just add a
prefix and truncate it later in the server.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]