Forum Discussion

EricCarlson's avatar
EricCarlson
Frequent Visitor
9 months ago
Solved

Materialized Views - Script to kick off the Run/Refresh?

I have created several Materialized Views in my lakehouse.  I can used the RUN button to perform update of all of those views.  I can also schedule the update.  All of that works fine.

 

But is there a way to trigger this same run/update process via a notebook command?

 

Use case:

I have other complex jobs orchestrated by various notebooks, which i run with a single 'master load' notebook set to run on a schedule, to update a bunch of source tables.  Once all of those jobs are finished, THEN I need to update all of my Materalized Views, which depend on those source tables.  So it would be best to be able to kick off the Materialized View update process as soon as all those other jobs are done, via the same mater load notebook.

 

I know that I can update individual Materialized Views one by one, but I want to take advantage of the power of the Materialized View system which update all of the tables, in the correct dependency order.

5 Replies