2020rem Figure out where the Spark framework is installed
2121set SPARK_HOME = %~dp0 ..
2222
23- call %SPARK_HOME% \bin\load-spark-env.cmd
23+ call " %SPARK_HOME% \bin\load-spark-env.cmd"
2424
2525rem Test that an argument was given
2626if " x%1 " == " x" (
@@ -32,9 +32,9 @@ rem Find assembly jar
3232set SPARK_ASSEMBLY_JAR = 0
3333
3434if exist " %SPARK_HOME% \RELEASE" (
35- set ASSEMBLY_DIR = %SPARK_HOME% \lib
35+ set ASSEMBLY_DIR = " %SPARK_HOME% \lib"
3636) else (
37- set ASSEMBLY_DIR = %SPARK_HOME% \assembly\target\scala-%SPARK_SCALA_VERSION%
37+ set ASSEMBLY_DIR = " %SPARK_HOME% \assembly\target\scala-%SPARK_SCALA_VERSION% "
3838)
3939
4040for %%d in (%ASSEMBLY_DIR% \spark-assembly*hadoop*.jar) do (
@@ -50,7 +50,7 @@ set LAUNCH_CLASSPATH=%SPARK_ASSEMBLY_JAR%
5050
5151rem Add the launcher build dir to the classpath if requested.
5252if not " x%SPARK_PREPEND_CLASSES% " == " x" (
53- set LAUNCH_CLASSPATH = %SPARK_HOME% \launcher\target\scala-%SPARK_SCALA_VERSION% \classes;%LAUNCH_CLASSPATH%
53+ set LAUNCH_CLASSPATH = " %SPARK_HOME% \launcher\target\scala-%SPARK_SCALA_VERSION% \classes;%LAUNCH_CLASSPATH% "
5454)
5555
5656set _SPARK_ASSEMBLY = %SPARK_ASSEMBLY_JAR%
@@ -62,7 +62,7 @@ if not "x%JAVA_HOME%"=="x" set RUNNER=%JAVA_HOME%\bin\java
6262rem The launcher library prints the command to be executed in a single line suitable for being
6363rem executed by the batch interpreter. So read all the output of the launcher into a variable.
6464set LAUNCHER_OUTPUT = %temp% \spark-class-launcher-output-%RANDOM% .txt
65- " %RUNNER% " -cp %LAUNCH_CLASSPATH% org.apache.spark.launcher.Main %* > %LAUNCHER_OUTPUT%
65+ " %RUNNER% " -cp " %LAUNCH_CLASSPATH% " org.apache.spark.launcher.Main %* > %LAUNCHER_OUTPUT%
6666for /f " tokens=*" %%i in (%LAUNCHER_OUTPUT% ) do (
6767 set SPARK_CMD = %%i
6868)
0 commit comments