Skip to content

Commit beb9cba

Browse files
andrewor14pwendell
authored andcommitted
[SPARK-1736] Spark submit for Windows
Tested on Windows 7. Author: Andrew Or <[email protected]> Closes apache#745 from andrewor14/windows-submit and squashes the following commits: c0b58fb [Andrew Or] Allow spaces in parameters 162e54d [Andrew Or] Merge branch 'master' of github.com:apache/spark into windows-submit 91597ce [Andrew Or] Make spark-shell.cmd use spark-submit.cmd af6fd29 [Andrew Or] Add spark submit for Windows
1 parent 4b31f4e commit beb9cba

File tree

2 files changed

+58
-3
lines changed

2 files changed

+58
-3
lines changed

bin/spark-shell.cmd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ rem See the License for the specific language governing permissions and
1717
rem limitations under the License.
1818
rem
1919

20-
rem Find the path of sbin
21-
set BIN=%~dp0..\bin\
20+
set SPARK_HOME=%~dp0..
2221

23-
cmd /V /E /C %BIN%spark-class2.cmd org.apache.spark.repl.Main %*
22+
cmd /V /E /C %SPARK_HOME%\bin\spark-submit.cmd spark-internal %* --class org.apache.spark.repl.Main

bin/spark-submit.cmd

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@echo off
2+
3+
rem
4+
rem Licensed to the Apache Software Foundation (ASF) under one or more
5+
rem contributor license agreements. See the NOTICE file distributed with
6+
rem this work for additional information regarding copyright ownership.
7+
rem The ASF licenses this file to You under the Apache License, Version 2.0
8+
rem (the "License"); you may not use this file except in compliance with
9+
rem the License. You may obtain a copy of the License at
10+
rem
11+
rem http://www.apache.org/licenses/LICENSE-2.0
12+
rem
13+
rem Unless required by applicable law or agreed to in writing, software
14+
rem distributed under the License is distributed on an "AS IS" BASIS,
15+
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
rem See the License for the specific language governing permissions and
17+
rem limitations under the License.
18+
rem
19+
20+
set SPARK_HOME=%~dp0..
21+
set ORIG_ARGS=%*
22+
23+
rem Clear the values of all variables used
24+
set DEPLOY_MODE=
25+
set DRIVER_MEMORY=
26+
set SPARK_SUBMIT_LIBRARY_PATH=
27+
set SPARK_SUBMIT_CLASSPATH=
28+
set SPARK_SUBMIT_OPTS=
29+
set SPARK_DRIVER_MEMORY=
30+
31+
:loop
32+
if [%1] == [] goto continue
33+
if [%1] == [--deploy-mode] (
34+
set DEPLOY_MODE=%2
35+
) else if [%1] == [--driver-memory] (
36+
set DRIVER_MEMORY=%2
37+
) else if [%1] == [--driver-library-path] (
38+
set SPARK_SUBMIT_LIBRARY_PATH=%2
39+
) else if [%1] == [--driver-class-path] (
40+
set SPARK_SUBMIT_CLASSPATH=%2
41+
) else if [%1] == [--driver-java-options] (
42+
set SPARK_SUBMIT_OPTS=%2
43+
)
44+
shift
45+
goto loop
46+
:continue
47+
48+
if [%DEPLOY_MODE%] == [] (
49+
set DEPLOY_MODE=client
50+
)
51+
52+
if not [%DRIVER_MEMORY%] == [] if [%DEPLOY_MODE%] == [client] (
53+
set SPARK_DRIVER_MEMORY=%DRIVER_MEMORY%
54+
)
55+
56+
cmd /V /E /C %SPARK_HOME%\bin\spark-class.cmd org.apache.spark.deploy.SparkSubmit %ORIG_ARGS%

0 commit comments

Comments
 (0)