Confusion about {{run_id}} and {{parent_run_id}} variables for Databricks jobs (Azure)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 01:52 AM
In Databricks jobs on Azure you can use the {{run_id}} and {{parent_run_id}}
variables for a specific run: https://docs.databricks.com/workflows/jobs/jobs.html
For Databricks jobs with only two or more tasks, then {{run_id}} seems to correspond to
task_run_id and {{parent_run_id}} seems to correspond to the job_run_id.
For Databricks jobs with only one task, then
{{parent_run_id}} seems to correspond to the task_run_id, but what does the
{{run_id}} correspond to? Is that the job_run_id?
![](/skins/images/F150478535D6FB5A5FF0311D4528FC89/responsive_peak/images/icon_anonymous_profile.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 08:44 AM
@Kasper H :
Yes, you are correct in your understanding that in Databricks jobs with multiple tasks, the {{run_id}} variable corresponds to the task_run_id and the {{parent_run_id}} variable corresponds to the job_run_id.
For Databricks jobs with only one task, the {{parent_run_id}} variable still corresponds to the task_run_id, which is the unique identifier for that particular run of the task. In this case, the {{run_id}} variable would correspond to the job_run_id, which is the unique identifier for the entire job run that includes that single task.
So, in summary:
- For Databricks jobs with multiple tasks: {{run_id}} = task_run_id, {{parent_run_id}} = job_run_id
- For Databricks jobs with only one task: {{run_id}} = job_run_id, {{parent_run_id}} = task_run_id
![](/skins/images/582998B45490C7019731A5B3A872C751/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/582998B45490C7019731A5B3A872C751/responsive_peak/images/icon_anonymous_message.png)