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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]