ALTER MATERIALIZED VIEW REWRITE
You can enable or disable the rewriting of queries based on a particular materialized view.
Syntax
ALTER MATERIALIZED VIEW [db_name.]materialized_view_name ENABLE|DISABLE REWRITE;
- db_name.materialized_view_name
- The database name followed by the name for the materialized view in dot notation.
Description
To optimize performance, by default, Hive rewrites a query based on materialized views. You can change this behavior to manage query planning and execution manually. By setting the hive.materializedview.rewriting global
property, you can manage query rewriting based on materialized views for all queries.
Example
ALTER MATERIALIZED VIEW mydb.mv1 DISABLE REWRITE;