I need to return back "DEAD"/"FAIL" to the job "status" if the pyspark job matches a certain condiftion. Example:
from pyspark.sql import SparkSession
spark = SparkSession.builder\
.master("yarn")\
.appName("IDL") \
.getOrCreate()
for i in range(0,10):
if i ==5:
print("Bye " + str(i))
#Exit the program and return status code
The return has to be explicity done through the pyspark program. Depending on the status, the next pyspark job would run.
Job Submit:
curl -X POST --data '{"file": "/user/root/jsmith/test1.py"}' -H "Content-Type: application/json" localhost:8998/batches
Fetch Job status:
curl localhost:8998/sessions/7
Output of above command should have "state":"DEAD".