spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From felixcheung <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-12146] [SparkR] SparkR jsonFile should ...
Date Mon, 07 Dec 2015 21:53:05 GMT
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10145#discussion_r46883335
  
    --- Diff: R/pkg/R/SQLContext.R ---
    @@ -208,24 +208,32 @@ setMethod("toDF", signature(x = "RDD"),
     #' @param sqlContext SQLContext to use
     #' @param path Path of file to read. A vector of multiple paths is allowed.
     #' @return DataFrame
    +#' @rdname read.json
    +#' @name read.json
     #' @export
     #' @examples
     #'\dontrun{
     #' sc <- sparkR.init()
     #' sqlContext <- sparkRSQL.init(sc)
     #' path <- "path/to/file.json"
    -#' df <- jsonFile(sqlContext, path)
    +#' df <- read.json(sqlContext, path)
     #' }
    -
    -jsonFile <- function(sqlContext, path) {
    +read.json <- function(sqlContext, path) {
       # Allow the user to have a more flexible definiton of the text file path
    -  path <- suppressWarnings(normalizePath(path))
    -  # Convert a string vector of paths to a string containing comma separated paths
    -  path <- paste(path, collapse = ",")
    -  sdf <- callJMethod(sqlContext, "jsonFile", path)
    +  paths <- as.list(suppressWarnings(normalizePath(splitString(path))))
    --- End diff --
    
    I thought @sun-rui noted we should take a list or vector? In such case we should change
this code to
    ```
    paths <- as.list(suppressWarnings(normalizePath(path)))
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message