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
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!