Walter_C
Databricks Employee
Databricks Employee

To get the update_id for a specific refresh of an online table and retrieve its status, you can follow these steps:

Obtaining the update_id

When you trigger a refresh of an online table through a workflow job, you can typically access the update_id in one of two ways:

  1. Workflow output: Many workflow systems provide a way to capture the output or return value of the refresh operation. Check your workflow execution logs or output variables for the update_id.
  2. Query the event log: If the workflow doesn't directly provide the update_id, you can query the event log to find the most recent update for your table.
SELECT origin.update_id AS id FROM event_log_raw WHERE event_type = 'create_update' ORDER BY timestamp DESC LIMIT 1;

This query will return the update_id of the most recent update operation

Retrieving the status

Once you have the update_id, you can query the status of that specific update:

SELECT status FROM event_log_raw WHERE event_type = 'update_progress' AND origin.update_id = '<your_update_id>' ORDER BY timestamp DESC LIMIT 1;

Replace <your_update_id> with the actual update_id you obtained