- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2025 04:35 AM
When creating materialized view with spark.sql function it returns following error message.
[MATERIALIZED_VIEW_OPERATION_NOT_ALLOWED.MV_NOT_ENABLED] The materialized view operation CREATE is not allowed: Materialized view features are not enabled for your workspace. Please reach out to Databricks to enable materialized views for your workspace. SQLSTATE: 56038
But I can create materialized view with sql editor, I have create materialized view permission on target catalog and schema.
Is this a known issue with spark.sql ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2025 06:54 AM - edited 10-14-2025 06:54 AM
Hi @donlxz ,
When you look at documentation, they only available way to create materialized view is by executing CREATE MATERIALIZED VIEW statement. You can submit that statement via SQL editor, Azure Databricks UI, Databricsk CLI or Databricks SQL API.
Use materialized views in Databricks SQL - Azure Databricks | Microsoft Learn
So, you can't create materialized view wiht spark.sql approach.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2025 07:12 PM
Hi, @szymon_dybczak
Thank you for your response.
You're right, it was mentioned in the documentation—I missed it when checking.
I understand now that it's not possible to do this with spark.sql. Thanks for clarifying!