Skip to content

Commit 499e8e1

Browse files
lresendeshivaram
authored andcommitted
[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.
1 parent e2a8430 commit 499e8e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

R/pkg/R/SQLContext.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ setMethod("toDF", signature(x = "RDD"),
201201

202202
jsonFile <- function(sqlContext, path) {
203203
# Allow the user to have a more flexible definiton of the text file path
204-
path <- normalizePath(path)
204+
path <- suppressWarnings(normalizePath(path))
205205
# Convert a string vector of paths to a string containing comma separated paths
206206
path <- paste(path, collapse = ",")
207207
sdf <- callJMethod(sqlContext, "jsonFile", path)
@@ -251,7 +251,7 @@ jsonRDD <- function(sqlContext, rdd, schema = NULL, samplingRatio = 1.0) {
251251
# TODO: Implement saveasParquetFile and write examples for both
252252
parquetFile <- function(sqlContext, ...) {
253253
# Allow the user to have a more flexible definiton of the text file path
254-
paths <- lapply(list(...), normalizePath)
254+
paths <- lapply(list(...), function(x) suppressWarnings(normalizePath(x)))
255255
sdf <- callJMethod(sqlContext, "parquetFile", paths)
256256
dataFrame(sdf)
257257
}

R/pkg/R/sparkR.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ sparkR.init <- function(
160160
})
161161

162162
if (nchar(sparkHome) != 0) {
163-
sparkHome <- normalizePath(sparkHome)
163+
sparkHome <- suppressWarnings(normalizePath(sparkHome))
164164
}
165165

166166
sparkEnvirMap <- new.env()

0 commit comments

Comments
 (0)