cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve a Job Name from the SparkContext

HHol
New Contributor

We are currently starting to build certain data pipelines using Databricks.

For this we use Jobs and the steps in these Jobs are implemented in Python Wheels.

We are able to retrieve the Job ID, Job Run ID and Task Run Id in our Python Wheels from the SparkContext using:

 

from pyspark.context import SparkContext
sc = SparkContext.getOrCreate()
sc.getLocalProperty("spark.databricks.job.id")
sc.getLocalProperty("spark.databricks.job.parentRunId")
sc.getLocalProperty("spark.databricks.job.runId")
 
Now we would also like to get the name of the current Job which is running the wheel. Is there any local property containing that information? So far we did not manage to retrieve all available Keys which are stored as local Properties. Is there any documentation describing all available Properties? We did not find anything out there...
 
Thanks in advance for your advice!
0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group