Use the CREATE MATERIALIZED VIEW
command to create a materialized view. A materialized view can be created based on sources, tables, materialized views, or indexes.
Parameter or clause | Description |
---|---|
mv_name | The name of the materialized view to be created. |
select_query | A SELECT query that retrieves data for the materialized view. See SELECT for the syntax and examples of the SELECT command. |
WITH clause | Specifies optional parameters for the materialized view. For example, source_rate_limit to set the ingestion rate, and backfill_order to control the backfill order. |
ORDER BY
clause in the CREATE MATERIALIZED VIEW
statement is allowed but not considered as part of the definition of the materialized view. It’s only used in the initial creation of the materialized view and not during refreshes.CREATE MATERIALIZED VIEW
will first backfill historical data from the referenced relations, and completion time varies based on the volume of data to be backfilled.
SET BACKGROUND_DDL=true;
before running the CREATE MATERIALIZED VIEW
statement. See details in SET BACKGROUND_DDL.
backfill_order
in the WITH
clause to control the backfill order for different upstream relations. Use the ->
operator to define dependencies between tables. The left relation will be fully backfilled before the right relation begins.
dot
formatted graph of your backfill orders:
backfill_order
feature is currently in technical preview stage.MATERIALIZED VIEW
.backfill_order
clause are not supported.