From 7a9e25c38380e6c62080d62ad38a4830e44fe753 Mon Sep 17 00:00:00 2001 From: Jeff Zhang Date: Thu, 11 Aug 2016 20:08:25 -0700 Subject: [SPARK-13081][PYSPARK][SPARK_SUBMIT] Allow set pythonExec of driver and executor through conf… MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this PR, user have to export environment variable to specify the python of driver & executor which is not so convenient for users. This PR is trying to allow user to specify python through configuration "--pyspark-driver-python" & "--pyspark-executor-python" Manually test in local & yarn mode for pyspark-shell and pyspark batch mode. Author: Jeff Zhang Closes #13146 from zjffdu/SPARK-13081. --- .../test/java/org/apache/spark/launcher/SparkLauncherSuite.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/src/test/java') diff --git a/core/src/test/java/org/apache/spark/launcher/SparkLauncherSuite.java b/core/src/test/java/org/apache/spark/launcher/SparkLauncherSuite.java index e393db06a0..682d98867b 100644 --- a/core/src/test/java/org/apache/spark/launcher/SparkLauncherSuite.java +++ b/core/src/test/java/org/apache/spark/launcher/SparkLauncherSuite.java @@ -28,6 +28,8 @@ import org.slf4j.LoggerFactory; import org.slf4j.bridge.SLF4JBridgeHandler; import static org.junit.Assert.*; +import org.apache.spark.internal.config.package$; + /** * These tests require the Spark assembly to be built before they can be run. */ @@ -89,6 +91,12 @@ public class SparkLauncherSuite { launcher.setConf("spark.foo", "foo"); launcher.addSparkArg(opts.CONF, "spark.foo=bar"); assertEquals("bar", launcher.builder.conf.get("spark.foo")); + + launcher.setConf(SparkLauncher.PYSPARK_DRIVER_PYTHON, "python3.4"); + launcher.setConf(SparkLauncher.PYSPARK_PYTHON, "python3.5"); + assertEquals("python3.4", launcher.builder.conf.get( + package$.MODULE$.PYSPARK_DRIVER_PYTHON().key())); + assertEquals("python3.5", launcher.builder.conf.get(package$.MODULE$.PYSPARK_PYTHON().key())); } @Test(expected=IllegalStateException.class) -- cgit v1.2.3