prestodb / presto

The official home of the Presto distributed SQL query engine for big data
http://prestodb.io
Apache License 2.0
16.02k stars 5.36k forks source link

Support materialized view semantics #16171

Open sufism opened 3 years ago

sufism commented 3 years ago

We noticed that the issues related to materialized views are mainly focused on reading the hive materialized views. We want to develop more:

  1. Support materialized views based on other data sources, such like
    CREATE MATERIALIZED VIEW xxx ...
    as
    select * from mysql_tbl join hive_tbl...
  2. Support refresh command to update the content of the materialized view.
  3. Support some basic query rewriting rules, such as rules already supported by hive.
  4. The life cycle of the materialized view can also refer to the implementation of hive. If the table version information is available ( with connector) , optimizer can use the version information to determine whether the materialized view is outdated; otherwise, user can use a table property to  define required freshness of the materialized view data, so that the materialized view can still be used for rewriting for a specified period of time after refreshing.
sufism commented 3 years ago

@jainxrohit

rohanpednekar commented 3 years ago

@sufism, You are very welcome to submit a PR and I will find a review for you. Thank you.