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

    https://github.com/apache/spark/pull/17274#discussion_r107162373
  
    --- Diff: R/pkg/R/context.R ---
    @@ -345,7 +351,7 @@ spark.getSparkFilesRootDirectory <- function() {
     #'}
     #' @note spark.getSparkFiles since 2.1.0
     spark.getSparkFiles <- function(fileName) {
    -  callJStatic("org.apache.spark.SparkFiles", "get", as.character(fileName))
    +  file.path(spark.getSparkFilesRootDirectory(), as.character(fileName))
    --- End diff --
    
    I changed to call ```SparkFiles``` if running on driver like before, here 
we do the best possible to use the Scala implementation. With respect to 
running on executors, we have no better choice.
    We already have test coverage for ```spark.getSparkFiles``` on driver and 
executors. To some illegal arguments, such as fileName is absolute path, it 
can't handle in Scala API as well.


---
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