I want to do some clean-ups after a Spark job is finished, and the action I would do depends on whether the job is successful or not.
So how where can I get the result for the job? I already tried the SparkListener, it worked fine when the job is successful, but if the job fails, the listener seems not called.