Repository: spark
Updated Branches:
  refs/heads/branch-1.4 c103c99d2 -> 8dfdca46d


Use vector-friendly comparison for packages argument.

Otherwise, `sparkR.init()` with multiple `sparkPackages` results in this 
warning:

```
Warning message:
In if (packages != "") { :
  the condition has length > 1 and only the first element will be used
```

Author: trestletech <jeff.al...@trestletechnology.net>

Closes #7701 from trestletech/compare-packages and squashes the following 
commits:

72c8b36 [trestletech] Correct function name.
c52db0e [trestletech] Added test for multiple packages.
3aab1a7 [trestletech] Use vector-friendly comparison for packages argument.

(cherry picked from commit 614323406225a3522ee601935ce3052449614145)
Signed-off-by: Shivaram Venkataraman <shiva...@cs.berkeley.edu>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/8dfdca46
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/8dfdca46
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/8dfdca46

Branch: refs/heads/branch-1.4
Commit: 8dfdca46dd2f527bf653ea96777b23652bc4eb83
Parents: c103c99
Author: trestletech <jeff.al...@trestletechnology.net>
Authored: Tue Jul 28 10:45:19 2015 -0700
Committer: Shivaram Venkataraman <shiva...@cs.berkeley.edu>
Committed: Tue Jul 28 10:45:57 2015 -0700

----------------------------------------------------------------------
 R/pkg/R/client.R               | 2 +-
 R/pkg/inst/tests/test_client.R | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/8dfdca46/R/pkg/R/client.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/client.R b/R/pkg/R/client.R
index 78c7a30..a294fc4 100644
--- a/R/pkg/R/client.R
+++ b/R/pkg/R/client.R
@@ -48,7 +48,7 @@ generateSparkSubmitArgs <- function(args, sparkHome, jars, 
sparkSubmitOpts, pack
     jars <- paste("--jars", jars)
   }
 
-  if (packages != "") {
+  if (!identical(packages, "")) {
     packages <- paste("--packages", packages)
   }
 

http://git-wip-us.apache.org/repos/asf/spark/blob/8dfdca46/R/pkg/inst/tests/test_client.R
----------------------------------------------------------------------
diff --git a/R/pkg/inst/tests/test_client.R b/R/pkg/inst/tests/test_client.R
index 30b05c1..8a20991 100644
--- a/R/pkg/inst/tests/test_client.R
+++ b/R/pkg/inst/tests/test_client.R
@@ -30,3 +30,7 @@ test_that("no package specified doesn't add packages flag", {
   expect_equal(gsub("[[:space:]]", "", args),
                "")
 })
+
+test_that("multiple packages don't produce a warning", {
+  expect_that(generateSparkSubmitArgs("", "", "", "", c("A", "B")), 
not(gives_warning()))
+})


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to