I am trying to learn how to run a pyspark script using SPARK REST API.
I followed this link: http://arturmkrtchyan.com/apache-spark-hidden-rest-api and found this:
curl -X POST http://localhost:6066/v1/submissions/create --header "Content-Type:application/json;charset=UTF-8" --data '{
"action" : "CreateSubmissionRequest",
"appArgs" : [ "pi.py" ],
"appResource" : "file:learning/pi.py",
"clientSparkVersion" : "1.6.1",
"environmentVariables" : {
"SPARK_ENV_LOADED" : "1"
},
"mainClass" : "org.apache.spark.deploy.SparkSubmit",
"sparkProperties" : {
"spark.driver.supervise" : "false",
"spark.app.name" : "Simple App",
"spark.eventLog.enabled": "true",
"spark.submit.deployMode" : "cluster",
"spark.master" : "spark://localhost:6066"
}
}'
Well it worked but I don't know what
"SPARK_ENV_LOADED" : "1"
means. Can someone explain please? it will help me proceed further.
Also, If someone knows a better way of doing the same please let me know. I am new at this.
Thanks