Skip to content

Commit 7059639

Browse files
committed
More conservative : Check before adding quotes in spark/bin/spark-submit.cmd files. In fact the same effect as last commit because currently it doesn't work if full path to spark-submit.cmd has space.
1 parent a6b1c60 commit 7059639

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

bin/spark-class.cmd

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

23-
cmd /V /E /C %~dp0spark-class2.cmd %*
23+
echo "%~dp0spark-class2.cmd"|findstr /C:" "
24+
if %ERRORLEVEL% EQU 0 (
25+
cmd /V /E /C "%~dp0spark-class2.cmd" %*
26+
) else (
27+
cmd /V /E /C %~dp0spark-class2.cmd %*
28+
)

bin/spark-shell.cmd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@ rem
2020
rem This is the entry point for running Spark shell. 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-shell2.cmd %*
23+
echo "%~dp0spark-shell2.cmd"|findstr /C:" "
24+
if %ERRORLEVEL% EQU 0 (
25+
cmd /V /E /C "%~dp0spark-shell2.cmd" %*
26+
) else (
27+
cmd /V /E /C %~dp0spark-shell2.cmd %*
28+
)

bin/spark-submit.cmd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@ 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+
echo "%~dp0spark-submit2.cmd"|findstr /C:" "
24+
if %ERRORLEVEL% EQU 0 (
25+
cmd /V /E /C "%~dp0spark-submit2.cmd" %*
26+
) else (
27+
cmd /V /E /C %~dp0spark-submit2.cmd %*
28+
)

0 commit comments

Comments
 (0)