Syntax
Parameters
| 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. |
Names and unquoted identifiers are case-insensitive. Therefore, you must double-quote any of these fields for them to be case-sensitive. See also Identifiers.
The
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.Backfill behavior and controls
-
CREATE MATERIALIZED VIEWwill first backfill historical data from the referenced relations, and completion time varies based on the volume of data to be backfilled. -
To perform the operations in the background, you can execute
SET BACKGROUND_DDL=true;before running theCREATE MATERIALIZED VIEWstatement. See details in SET BACKGROUND_DDL. -
You can specify
backfill_orderin theWITHclause 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.To view progress of each backfill fragment:To inspect the structure of the running streaming job:To dump adotformatted graph of your backfill orders:- The
backfill_orderfeature is currently in technical preview stage. - It is supported only for
MATERIALIZED VIEW. - Backfill order recovery is not supported for background ddl. If a backfilling job restarts, the specified order will be lost, and all tables will backfill concurrently.
- Cross-database scans inside the
backfill_orderclause are not supported.
- The