How to create a Materialized View in Azure Databricks stored in a Managed Catalog, based on data loaded from a foreign catalog

Kohdai Kurihara 20 Reputation points
2025-03-07T05:03:46.0333333+00:00

I am currently facing a problem with creating a materialized view in Catalog_2.Schema_B (Managed_Catalog) based on data I have connected from postgre SQL external source loaded into Catalog1_Schema_A (Foreign_Catalog).

The error I get only says "schema_a.postres.database.azure.com" which maybe suggests it is a connectivity issue to the Foreign catalog. However, I can see that the data is loaded in properly.

I have confirmed that

  • I have all the privileges necessary on both Schemas A and B
  • I am using Unity Catalog enabled pro SQLwarehouse.
  • I can use a select query to directly Select a table from Schema_A
  • It seems like I can create a view but not a materialized view.
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,361 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 29,711 Reputation points
    2025-03-07T13:08:36.9233333+00:00

    The error message you provided (schema_a.postres.database.azure.com) is more about a connectivity issue.

    Materialized views need to be refreshed to update the data. You can refresh the materialized view using the REFRESH MATERIALIZED VIEW statement.

    REFRESH MATERIALIZED VIEW Catalog_2.Schema_B.my_materialized_view;
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.