When I do spark-submit
with spark-csv
, I use the following command
spark-submit --master spark://10.0.0.1:7077 --packages com.databricks:spark-csv_2.11:1.2.0 MyApp.jar
(note: I'm using --packages com.databricks:spark-csv_2.11:1.2.0
)
The question is: How can I do that with spark launcher (I can't find where to put in the package information from the API)?
(Following is the code I'm using)
import org.apache.spark.launcher.SparkLauncher
object Launcher extends App {
val spark = new SparkLauncher()
.setSparkHome("/myspark1.5.1path/")
.setAppResource("/mypath/MyApp.jar")
.setMainClass("MyApp")
.setMaster("local[*]")
.launch()
spark.waitFor()
}