aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciano Resende <lresende@apache.org>2015-08-28 09:13:21 -0700
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2015-08-28 09:13:54 -0700
commit0abbc181380e644374f4217ee84b76fae035aee2 (patch)
tree52780edd2d9bf8146b6d715ab1c639aaf106d2b4
parent0cd49bacc8ec344a60bc2f5bf4c90cfd8c79abed (diff)
downloadspark-0abbc181380e644374f4217ee84b76fae035aee2.tar.gz
spark-0abbc181380e644374f4217ee84b76fae035aee2.tar.bz2
spark-0abbc181380e644374f4217ee84b76fae035aee2.zip
[SPARK-8952] [SPARKR] - Wrap normalizePath calls with suppressWarnings
This is based on davies comment on SPARK-8952 which suggests to only call normalizePath() when path starts with '~' Author: Luciano Resende <lresende@apache.org> Closes #8343 from lresende/SPARK-8952. (cherry picked from commit 499e8e154bdcc9d7b2f685b159e0ddb4eae48fe4) Signed-off-by: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
-rw-r--r--R/pkg/R/SQLContext.R4
-rw-r--r--R/pkg/R/sparkR.R2
2 files changed, 3 insertions, 3 deletions
diff --git a/R/pkg/R/SQLContext.R b/R/pkg/R/SQLContext.R
index 110117a18c..1bc6445311 100644
--- a/R/pkg/R/SQLContext.R
+++ b/R/pkg/R/SQLContext.R
@@ -201,7 +201,7 @@ setMethod("toDF", signature(x = "RDD"),
jsonFile <- function(sqlContext, path) {
# Allow the user to have a more flexible definiton of the text file path
- path <- normalizePath(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)
@@ -251,7 +251,7 @@ jsonRDD <- function(sqlContext, rdd, schema = NULL, samplingRatio = 1.0) {
# TODO: Implement saveasParquetFile and write examples for both
parquetFile <- function(sqlContext, ...) {
# Allow the user to have a more flexible definiton of the text file path
- paths <- lapply(list(...), normalizePath)
+ paths <- lapply(list(...), function(x) suppressWarnings(normalizePath(x)))
sdf <- callJMethod(sqlContext, "parquetFile", paths)
dataFrame(sdf)
}
diff --git a/R/pkg/R/sparkR.R b/R/pkg/R/sparkR.R
index e83104f116..3c57a44db2 100644
--- a/R/pkg/R/sparkR.R
+++ b/R/pkg/R/sparkR.R
@@ -160,7 +160,7 @@ sparkR.init <- function(
})
if (nchar(sparkHome) != 0) {
- sparkHome <- normalizePath(sparkHome)
+ sparkHome <- suppressWarnings(normalizePath(sparkHome))
}
sparkEnvirMap <- new.env()