Hi @DineshOjha,
Got it...that makes sense. If the views are logical objects that only need to be created once, I would treat them differently from the regularly scheduled table-refresh process.
My recommendation is to add a lightweight deployment step for metadata objects, such as views, separate from the scheduler. For example, you can use DEEP CLONE for the underlying Delta tables and then create the views as part of environment provisioning or deployment, not as part of the recurring schedule. You can then rerun the view DDL only when the definition changes, or when you are standing up or rebuilding the DR environment
That is generally not considered redundant, because a standard view does not process or write data. Databricks describes a view as a virtual table with no physical data, and creating a view just registers the query text in the metastore.
One option is to add a small post-provisioning SQL step in CI/CD that runs after the DR tables are available. For the initial creation, CREATE VIEW or CREATE VIEW IF NOT EXISTS is fine.
If you later need to change the definition of an existing view, one important nuance is that CREATE OR REPLACE VIEW replaces the existing view and does not preserve privileges granted on the original view. If you want to preserve grants while updating the definition, the docs recommend using ALTER VIEW ... AS ....
Hope this helps.
If this answer resolves your question, could you mark it as โAccept as Solutionโ? That helps other users quickly find the correct fix.
Regards,
Ashwin | Delivery Solution Architect @ Databricks
Helping you build and scale the Data Intelligence Platform.
***Opinions are my own***