-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17577][Follow-up][SparkR] SparkR spark.addFile supports adding directory recursively #15216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,17 +231,22 @@ setCheckpointDir <- function(sc, dirName) { | |
| #' filesystems), or an HTTP, HTTPS or FTP URI. To access the file in Spark jobs, | ||
| #' use spark.getSparkFiles(fileName) to find its download location. | ||
| #' | ||
| #' A directory can be given if the recursive option is set to true. | ||
| #' Currently directories are only supported for Hadoop-supported filesystems. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this might be a bit confusing - do we have links to what this mean?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The annotation here is consistent with Scala/Python, and Hadoop-supported filesystem is the file system which Hadoop supported. I think it's easy to understand for users. Or should we add a link to Hadoop-supported filesystems?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It depends. Recently someone was asking about why SparkR was using Hadoop file system classes to read NFS, local, etc. in the user list - it might not be obvious to users
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sense, added links to Hadoop-supported filesystem. Thanks! |
||
| #' Refer Hadoop-supported filesystems at \url{https://wiki.apache.org/hadoop/HCFS}. | ||
| #' | ||
| #' @rdname spark.addFile | ||
| #' @param path The path of the file to be added | ||
| #' @param recursive Whether to add files recursively from the path. Default is FALSE. | ||
| #' @export | ||
| #' @examples | ||
| #'\dontrun{ | ||
| #' spark.addFile("~/myfile") | ||
| #'} | ||
| #' @note spark.addFile since 2.1.0 | ||
| spark.addFile <- function(path) { | ||
| spark.addFile <- function(path, recursive = FALSE) { | ||
| sc <- getSparkContext() | ||
| invisible(callJMethod(sc, "addFile", suppressWarnings(normalizePath(path)))) | ||
| invisible(callJMethod(sc, "addFile", suppressWarnings(normalizePath(path)), recursive)) | ||
| } | ||
|
|
||
| #' Get the root directory that contains files added through spark.addFile. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd merge this into
@param pathbelow?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or omit this since it's described in
@param recursive?