Skip to content
Snippets Groups Projects
Commit e936cf80 authored by Shivaram Venkataraman's avatar Shivaram Venkataraman
Browse files

[SPARK-10219] [SPARKR] Fix varargsToEnv and add test case

cc sun-rui davies

Author: Shivaram Venkataraman <shivaram@cs.berkeley.edu>

Closes #8475 from shivaram/varargs-fix.
parent ce97834d
No related branches found
No related tags found
No related merge requests found
......@@ -314,7 +314,8 @@ convertEnvsToList <- function(keys, vals) {
# Utility function to capture the varargs into environment object
varargsToEnv <- function(...) {
pairs <- as.list(substitute(list(...)))[-1L]
# Based on http://stackoverflow.com/a/3057419/4577954
pairs <- list(...)
env <- new.env()
for (name in names(pairs)) {
env[[name]] <- pairs[[name]]
......
......@@ -1060,6 +1060,12 @@ test_that("parquetFile works with multiple input paths", {
parquetDF <- parquetFile(sqlContext, parquetPath, parquetPath2)
expect_is(parquetDF, "DataFrame")
expect_equal(count(parquetDF), count(df) * 2)
# Test if varargs works with variables
saveMode <- "overwrite"
mergeSchema <- "true"
parquetPath3 <- tempfile(pattern = "parquetPath3", fileext = ".parquet")
write.df(df, parquetPath2, "parquet", mode = saveMode, mergeSchema = mergeSchema)
})
test_that("describe() and summarize() on a DataFrame", {
......
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