cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we create Materialized view n exsting view and table?

sboxi
New Contributor

Dear All,

Is it possible to create Materialized view on view and table (Joining view and table)?

I suspect it is not possible. Please suggest.

Also please provide best way to schedule the refresh of Materialized view.

 

Regards,

Surya

 

1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

Hello @sboxi 

Can you try with this, as it looks it is possible, also about scheduling, please refer to below documentation you can use SCHEDULE clause.

 

CREATE MATERIALIZED VIEW IF NOT EXISTS my_materialized_view AS

SELECT

    t.column1,

    v.column2,

    AVG(t.column3) AS avg_column3

FROM

    my_table t

INNER JOIN

    my_view v

ON

    t.id = v.id

GROUP BY

    t.column1, v.column2;

https://docs.databricks.com/ja/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view.html

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group