Back to home page

OSCL-LXR

 
 

    


0001 @echo off
0002 
0003 rem
0004 rem Licensed to the Apache Software Foundation (ASF) under one or more
0005 rem contributor license agreements.  See the NOTICE file distributed with
0006 rem this work for additional information regarding copyright ownership.
0007 rem The ASF licenses this file to You under the Apache License, Version 2.0
0008 rem (the "License"); you may not use this file except in compliance with
0009 rem the License.  You may obtain a copy of the License at
0010 rem
0011 rem    http://www.apache.org/licenses/LICENSE-2.0
0012 rem
0013 rem Unless required by applicable law or agreed to in writing, software
0014 rem distributed under the License is distributed on an "AS IS" BASIS,
0015 rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0016 rem See the License for the specific language governing permissions and
0017 rem limitations under the License.
0018 rem
0019 
0020 rem Figure out where the Spark framework is installed
0021 call "%~dp0find-spark-home.cmd"
0022 
0023 set LF=^
0024 
0025 
0026 rem two empty lines are required
0027 set _SPARK_CMD_USAGE=Usage: .\bin\spark-shell.cmd [options]^%LF%%LF%^%LF%%LF%^
0028 Scala REPL options:^%LF%%LF%^
0029   -I ^<file^>                   preload ^<file^>, enforcing line-by-line interpretation
0030 
0031 rem SPARK-4161: scala does not assume use of the java classpath,
0032 rem so we need to add the "-Dscala.usejavacp=true" flag manually. We
0033 rem do this specifically for the Spark shell because the scala REPL
0034 rem has its own class loader, and any additional classpath specified
0035 rem through spark.driver.extraClassPath is not automatically propagated.
0036 if "x%SPARK_SUBMIT_OPTS%"=="x" (
0037   set SPARK_SUBMIT_OPTS=-Dscala.usejavacp=true
0038   goto run_shell
0039 )
0040 set SPARK_SUBMIT_OPTS="%SPARK_SUBMIT_OPTS% -Dscala.usejavacp=true"
0041 
0042 :run_shell
0043 "%SPARK_HOME%\bin\spark-submit2.cmd" --class org.apache.spark.repl.Main --name "Spark shell" %*