spark Yarn mode how to get applicationId from spark-submit spark Yarn mode how to get applicationId from spark-submit hadoop hadoop

spark Yarn mode how to get applicationId from spark-submit


Here are the approaches that I used to achieve this:

  1. Save the application Id to HDFS file. (Suggested by @zhangtong in comment).
  2. Send an email alert with applictionId from driver.