...
Code Block | ||||
---|---|---|---|---|
| ||||
ALTER MATERIALIZED VIEW [db_name.]materialized_view_name ENABLE|DISABLE REWRITE; |
...
Hive supports two types of rewriting algorithms:
- Algebraic: this is part of Apache Calcite and it supports queries
...
- containing TableScan, Project, Filter, Join, and Aggregate operators. More information about
...
- this rewriting coverage can be
...
- found here. In the following, we include a few examples that briefly illustrate different rewritings.
Example 1
Consider the database schema created by the following DDL statements:
...
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT floor(time to month), SUM(c_added) FROM mv3 GROUP BY floor(time to month); |
- SQL text: The materialized view definition query text is compared to the incoming query text or it's subquery text. It supports all kind of operators and aggregate functions.
Materialized view maintenance
...