Forum Discussion
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.
Hi EricCarlson ,
Thanks for reaching out to the Microsoft fabric community forum.Please go through the below documents which may help you in resolving the issue
Create and edit materialized views - Microsoft Fabric | Microsoft Learn
Materialized views - Kusto | Microsoft Learn
Materialized Lake Views Operational Run Details - Microsoft Fabric | Microsoft Learn
Schedule a Materialized Lake View Run - Microsoft Fabric | Microsoft Learn
Manage Fabric materialized lake views with public APIs - Microsoft Fabric | Microsoft Learn
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Community Support TeamYou can call all the API endpoints from Spark via python scripts.
5 Replies
- v-menakakotaCommunity Support
Hi EricCarlson ,
Thanks for reaching out to the Microsoft fabric community forum.Please go through the below documents which may help you in resolving the issue
Create and edit materialized views - Microsoft Fabric | Microsoft Learn
Materialized views - Kusto | Microsoft Learn
Materialized Lake Views Operational Run Details - Microsoft Fabric | Microsoft Learn
Schedule a Materialized Lake View Run - Microsoft Fabric | Microsoft Learn
Manage Fabric materialized lake views with public APIs - Microsoft Fabric | Microsoft Learn
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Community Support Team - EricCarlsonFrequent Visitor
Thanks, is see in the docs that there is a Rest API option to kick off a full refresh. A spark command could be nice, though!
- lbendlinSuper User
You can call all the API endpoints from Spark via python scripts.
- EricCarlsonFrequent Visitor
Thanks, I am new to Spark, did not know this. I will go down this path!