You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sh...@apache.org on 2015/08/27 07:27:35 UTC
spark git commit: [SPARK-10219] [SPARKR] Fix varargsToEnv and add
test case
Repository: spark
Updated Branches:
refs/heads/master ce97834dc -> e936cf808
[SPARK-10219] [SPARKR] Fix varargsToEnv and add test case
cc sun-rui davies
Author: Shivaram Venkataraman <sh...@cs.berkeley.edu>
Closes #8475 from shivaram/varargs-fix.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e936cf80
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e936cf80
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e936cf80
Branch: refs/heads/master
Commit: e936cf8088a06d6aefce44305f3904bbeb17b432
Parents: ce97834
Author: Shivaram Venkataraman <sh...@cs.berkeley.edu>
Authored: Wed Aug 26 22:27:31 2015 -0700
Committer: Shivaram Venkataraman <sh...@cs.berkeley.edu>
Committed: Wed Aug 26 22:27:31 2015 -0700
----------------------------------------------------------------------
R/pkg/R/utils.R | 3 ++-
R/pkg/inst/tests/test_sparkSQL.R | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/e936cf80/R/pkg/R/utils.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/utils.R b/R/pkg/R/utils.R
index 4f9f4d9..3babcb5 100644
--- a/R/pkg/R/utils.R
+++ b/R/pkg/R/utils.R
@@ -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]]
http://git-wip-us.apache.org/repos/asf/spark/blob/e936cf80/R/pkg/inst/tests/test_sparkSQL.R
----------------------------------------------------------------------
diff --git a/R/pkg/inst/tests/test_sparkSQL.R b/R/pkg/inst/tests/test_sparkSQL.R
index 8e22c56..4b672e1 100644
--- a/R/pkg/inst/tests/test_sparkSQL.R
+++ b/R/pkg/inst/tests/test_sparkSQL.R
@@ -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", {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org