Skip to content
Snippets Groups Projects
Commit 499e8e15 authored by Luciano Resende's avatar Luciano Resende Committed by Shivaram Venkataraman
Browse files

[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.
parent e2a84309
No related branches found
No related tags found
No related merge requests found
...@@ -201,7 +201,7 @@ setMethod("toDF", signature(x = "RDD"), ...@@ -201,7 +201,7 @@ setMethod("toDF", signature(x = "RDD"),
jsonFile <- function(sqlContext, path) { jsonFile <- function(sqlContext, path) {
# Allow the user to have a more flexible definiton of the text file 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 # Convert a string vector of paths to a string containing comma separated paths
path <- paste(path, collapse = ",") path <- paste(path, collapse = ",")
sdf <- callJMethod(sqlContext, "jsonFile", path) sdf <- callJMethod(sqlContext, "jsonFile", path)
...@@ -251,7 +251,7 @@ jsonRDD <- function(sqlContext, rdd, schema = NULL, samplingRatio = 1.0) { ...@@ -251,7 +251,7 @@ jsonRDD <- function(sqlContext, rdd, schema = NULL, samplingRatio = 1.0) {
# TODO: Implement saveasParquetFile and write examples for both # TODO: Implement saveasParquetFile and write examples for both
parquetFile <- function(sqlContext, ...) { parquetFile <- function(sqlContext, ...) {
# Allow the user to have a more flexible definiton of the text file path # 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) sdf <- callJMethod(sqlContext, "parquetFile", paths)
dataFrame(sdf) dataFrame(sdf)
} }
......
...@@ -160,7 +160,7 @@ sparkR.init <- function( ...@@ -160,7 +160,7 @@ sparkR.init <- function(
}) })
if (nchar(sparkHome) != 0) { if (nchar(sparkHome) != 0) {
sparkHome <- normalizePath(sparkHome) sparkHome <- suppressWarnings(normalizePath(sparkHome))
} }
sparkEnvirMap <- new.env() sparkEnvirMap <- new.env()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment