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 II

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

 

2 REPLIES 2

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

sboxi
New Contributor II

Thanks @Alberto_Umana . I will try that.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now