Skip to content

Commit c12d84b

Browse files
author
Marcelo Vanzin
committed
Review feedback. And fix spark-submit on Windows.
1 parent e2d4d71 commit c12d84b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

bin/spark-class

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ else
4141
fi
4242

4343
# Look for the launcher. In non-release mode, add the compiled classes directly to the classpath
44-
# instead of looking for a jar file, since it's very common for people using sbt to use the
45-
# "assembly" target instead of "package".
44+
# instead of looking for a jar file.
4645
SPARK_LAUNCHER_CP=
4746
if [ -f $SPARK_HOME/RELEASE ]; then
4847
LAUNCHER_DIR="$SPARK_HOME/lib"
@@ -72,8 +71,9 @@ else
7271
SPARK_LAUNCHER_CP="$LAUNCHER_DIR/classes"
7372
fi
7473

75-
# The launcher library will print arguments separated by a NULL character. Read that in a while
76-
# loop, populating an array that will be used to exec the final command.
74+
# The launcher library will print arguments separated by a NULL character, to allow arguments with
75+
# characters that would be otherwise interpreted by the shell. Read that in a while loop, populating
76+
# an array that will be used to exec the final command.
7777
CMD=()
7878
while IFS= read -d '' -r ARG; do
7979
CMD+=("$ARG")

bin/spark-class2.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ rem Figure out where java is.
6262
set RUNNER=java
6363
if not "x%JAVA_HOME%"=="x" set RUNNER=%JAVA_HOME%\bin\java
6464

65+
rem The launcher library prints the command to be executed in a single line suitable for being
66+
rem executed by the batch interpreter. So read all the output of the launcher into a variable.
6567
for /f "tokens=*" %%i in ('cmd /C ""%RUNNER%" -cp %LAUNCHER_CP% org.apache.spark.launcher.Main %*"') do (
6668
set SPARK_CMD=%%i
6769
)

bin/spark-submit.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ rem
2020
rem This is the entry point for running Spark submit. To avoid polluting the
2121
rem environment, it just launches a new cmd to do the real work.
2222

23-
cmd /V /E /C %~dp0spark-submit2.cmd %*
23+
cmd /V /E /C %~dp0spark-class2.cmd org.apache.spark.deploy.SparkSubmit %*

0 commit comments

Comments
 (0)