Sync Databricks rows on a schedule

Recipe ToolsMarketingWorkatodatabase

What it does

When the scheduled time arrives every 5 hours on weekdays, this automation selects rows from a Databricks table. It processes each row in a batch so the data stays current.

Who it's for

Data and analytics teams who need to refresh Databricks data on a regular weekday schedule.

How teams use this

Keep weekday data fresh in Databricks

Run the sync every 5 hours Monday through Thursday so the table always has current information. The schedule skips Friday and the weekend to avoid processing stale data.

Extend the schedule to include weekends

Remove the weekday condition so the automation runs every 5 hours all week long. Add a filter to only process rows where a status field equals active.

Route data to a second table

After each batch processes, send the results to a second Databricks table so both tables stay in sync. The schedule and row selection stay the same.

How it works

  1. Run every 5 hours on weekdays. The automation starts every 5 hours, but only on Monday through Thursday so weekend data is not processed.
  2. Select rows from the table. Query the userdb_ebada_yy.zsku_f6p table in Databricks and retrieve all matching rows for processing.
  3. Process each row in batch. Loop through each row returned from the table and handle them as a batch so all data is processed together.