Skip to content

Commit 2c20b0c

Browse files
author
Davies Liu
committed
fix launch spark-submit from python
1 parent 51a79a7 commit 2c20b0c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

bin/pyspark

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export PYTHONSTARTUP="$SPARK_HOME/python/pyspark/shell.py"
8989
if [[ -n "$SPARK_TESTING" ]]; then
9090
unset YARN_CONF_DIR
9191
unset HADOOP_CONF_DIR
92-
export PYSPARK_SUBMIT_ARGS=pyspark-shell
9392
if [[ -n "$PYSPARK_DOC_TEST" ]]; then
9493
exec "$PYSPARK_DRIVER_PYTHON" -m doctest $1
9594
else

python/pyspark/java_gateway.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ def launch_gateway():
3838
# proper classpath and settings from spark-env.sh
3939
on_windows = platform.system() == "Windows"
4040
script = "./bin/spark-submit.cmd" if on_windows else "./bin/spark-submit"
41-
submit_args = os.environ.get("PYSPARK_SUBMIT_ARGS")
42-
submit_args = submit_args if submit_args is not None else ""
43-
submit_args = shlex.split(submit_args)
44-
command = [os.path.join(SPARK_HOME, script)] + submit_args
41+
submit_args = os.environ.get("PYSPARK_SUBMIT_ARGS", "pyspark-shell")
42+
command = [os.path.join(SPARK_HOME, script)] + shlex.split(submit_args)
4543

4644
# Start a socket that will be used by PythonGatewayServer to communicate its port to us
4745
callback_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

0 commit comments

Comments
 (0)