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/07/28 19:45:23 UTC
spark git commit: Use vector-friendly comparison for packages
argument.
Repository: spark
Updated Branches:
refs/heads/master 35ef853b3 -> 614323406
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 <je...@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.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/61432340
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/61432340
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/61432340
Branch: refs/heads/master
Commit: 614323406225a3522ee601935ce3052449614145
Parents: 35ef853
Author: trestletech <je...@trestletechnology.net>
Authored: Tue Jul 28 10:45:19 2015 -0700
Committer: Shivaram Venkataraman <sh...@cs.berkeley.edu>
Committed: Tue Jul 28 10:45:19 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/61432340/R/pkg/R/client.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/client.R b/R/pkg/R/client.R
index 6f77215..c811d1d 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/61432340/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-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org