Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15131#discussion_r79722919
  
    --- Diff: R/pkg/R/context.R ---
    @@ -225,6 +225,51 @@ setCheckpointDir <- function(sc, dirName) {
       invisible(callJMethod(sc, "setCheckpointDir", 
suppressWarnings(normalizePath(dirName))))
     }
     
    +#' Add a file or directory to be downloaded with this Spark job on every 
node.
    +#'
    +#' The path passed can be either a local file, a file in HDFS (or other 
Hadoop-supported
    +#' filesystems), or an HTTP, HTTPS or FTP URI. To access the file in Spark 
jobs,
    +#' use spark.getSparkFiles(fileName) to find its download location.
    +#'
    +#' @rdname spark.addFile
    +#' @param path The path of the file to be added
    +#' @examples
    +#'\dontrun{
    +#' spark.addFile("~/myfile")
    +#'}
    +#' @note spark.addFile since 2.1.0
    +spark.addFile <- function(path) {
    +  sc <- getSparkContext()
    +  invisible(callJMethod(sc, "addFile", 
suppressWarnings(normalizePath(path))))
    +}
    +
    +#' Get the root directory that contains files added through spark.addFile.
    +#'
    +#' @rdname spark.getSparkFilesRootDirectory
    +#' @return the root directory that contains files added through 
spark.addFile
    +#' @examples
    +#'\dontrun{
    +#' spark.getSparkFilesRootDirectory()
    +#'}
    +#' @note spark.getSparkFilesRootDirectory since 2.1.0
    +spark.getSparkFilesRootDirectory <- function() {
    +  callJStatic("org.apache.spark.SparkFiles", "getRootDirectory")
    +}
    +
    +#' Get the absolute path of a file added through spark.addFile.
    +#'
    +#' @rdname spark.getSparkFiles
    +#' @param fileName The name of the file added through spark.addFile
    +#' @return the absolute path of a file added through spark.addFile.
    +#' @examples
    --- End diff --
    
    add @export


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to