diff options
author | Jeff Zhang <zjffdu@apache.org> | 2016-08-31 00:20:41 -0700 |
---|---|---|
committer | Felix Cheung <felixcheung@apache.org> | 2016-08-31 00:20:41 -0700 |
commit | fa6347938fc1c72ddc03a5f3cd2e929b5694f0a6 (patch) | |
tree | 7fc3cab4dc91e6b4ff04d6f88e6cddb1798a2944 /launcher/src/test | |
parent | d92cd227cf245be9ab8f9bce714386f8283a97cb (diff) | |
download | spark-fa6347938fc1c72ddc03a5f3cd2e929b5694f0a6.tar.gz spark-fa6347938fc1c72ddc03a5f3cd2e929b5694f0a6.tar.bz2 spark-fa6347938fc1c72ddc03a5f3cd2e929b5694f0a6.zip |
[SPARK-17178][SPARKR][SPARKSUBMIT] Allow to set sparkr shell command through --conf
## What changes were proposed in this pull request?
Allow user to set sparkr shell command through --conf spark.r.shell.command
## How was this patch tested?
Unit test is added and also verify it manually through
```
bin/sparkr --master yarn-client --conf spark.r.shell.command=/usr/local/bin/R
```
Author: Jeff Zhang <zjffdu@apache.org>
Closes #14744 from zjffdu/SPARK-17178.
Diffstat (limited to 'launcher/src/test')
-rw-r--r-- | launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java b/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java index 16e5a22401..ad2e7a70c4 100644 --- a/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java +++ b/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java @@ -173,6 +173,24 @@ public class SparkSubmitCommandBuilderSuite extends BaseSuite { } @Test + public void testSparkRShell() throws Exception { + List<String> sparkSubmitArgs = Arrays.asList( + SparkSubmitCommandBuilder.SPARKR_SHELL, + "--master=foo", + "--deploy-mode=bar", + "--conf", "spark.r.shell.command=/usr/bin/R"); + + Map<String, String> env = new HashMap<>(); + List<String> cmd = buildCommand(sparkSubmitArgs, env); + assertEquals("/usr/bin/R", cmd.get(cmd.size() - 1)); + assertEquals( + String.format( + "\"%s\" \"foo\" \"%s\" \"bar\" \"--conf\" \"spark.r.shell.command=/usr/bin/R\" \"%s\"", + parser.MASTER, parser.DEPLOY_MODE, SparkSubmitCommandBuilder.SPARKR_SHELL_RESOURCE), + env.get("SPARKR_SUBMIT_ARGS")); + } + + @Test public void testExamplesRunner() throws Exception { List<String> sparkSubmitArgs = Arrays.asList( SparkSubmitCommandBuilder.RUN_EXAMPLE, |