WeichenXu123 commented on code in PR #41357:
URL: https://github.com/apache/spark/pull/41357#discussion_r1212596759
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/artifact/SparkConnectArtifactManager.scala:
##########
@@ -157,10 +159,34 @@ class SparkConnectArtifactManager private[connect] {
}
}
}
+
+ private[connect] def uploadArtifactToFs(
+ sessionHolder: SessionHolder,
+ remoteRelativePath: Path,
+ serverLocalStagingPath: Path): Unit = {
+ val hadoopConf = sessionHolder.session.sparkContext.hadoopConfiguration
+ assert(remoteRelativePath.startsWith(
+ SparkConnectArtifactManager.forwardToFSPrefix + File.separator)
+ )
+ val destFSPath = new FSPath(
+ Paths.get("/").resolve(
+ remoteRelativePath.subpath(1,
remoteRelativePath.getNameCount)).toString
+ )
+ val localPath = serverLocalStagingPath
+ val fs = destFSPath.getFileSystem(hadoopConf)
+ fs.copyFromLocalFile(
+ false,
+ true,
+ new FSPath(localPath.toString),
+ destFSPath
Review Comment:
The code here saves file to cloud storage file system.
--
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]