From 384066249358358a05dead9b6438369f9267b2da Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Mon, 4 Dec 2023 14:55:08 -0500 Subject: [PATCH 01/37] add materialized view configuration --- .../resource-configs/bigquery-configs.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/website/docs/reference/resource-configs/bigquery-configs.md b/website/docs/reference/resource-configs/bigquery-configs.md index ffbaa37c059..eabefe90d4e 100644 --- a/website/docs/reference/resource-configs/bigquery-configs.md +++ b/website/docs/reference/resource-configs/bigquery-configs.md @@ -718,3 +718,100 @@ Views with this configuration will be able to select from objects in `project_1. The `grant_access_to` config is not thread-safe when multiple views need to be authorized for the same dataset. The initial `dbt run` operation after a new `grant_access_to` config is added should therefore be executed in a single thread. Subsequent runs using the same configuration will not attempt to re-apply existing access grants, and can make use of multiple threads. + + +## Materialized views + +The BigQuery adapter supports [materialized views](https://cloud.google.com/bigquery/docs/materialized-views-intro) +with the following configuration parameters: + +| Parameter | Type | Default | Change Monitoring Support | Reference | +|------------------------------|----------------------|---------|---------------------------|--------------------------------------------------| +| `cluster_by` | LIST[STRING] | `None` | DROP/CREATE | [Clustering](#clustering-clause) | +| `partition_by` | DICT | `None` | DROP/CREATE | [Partitioning](#partition-clause) | +| `enable_refresh` | BOOLEAN | `True` | ALTER | [Auto-refresh](#auto-refresh) | +| `refresh_interval_minutes` | FLOAT | `30` | ALTER | [Auto-refresh](#auto-refresh) | +| `max_staleness` (in Preview) | INTERVAL | `None` | ALTER | [Auto-refresh](#auto-refresh) | +| `description` | STRING | `None` | ALTER | | +| `labels` | DICT[STRING, STRING] | `None` | ALTER | [Labels](#specifying-labels) | +| `hours_to_expiration` | INTEGER | `None` | ALTER | [Table expiration](controlling-table-expiration) | +| `kms_key_name` | STRING | `None` | ALTER | [KMS encryption](#using-kms-encryption) | + +#### Sample model file: + + + +```sql +{{ config( + materialized='materialized_view', + cluster_by=['', ...], + partition_by={ + 'field': '', + 'data_type': '', + + # only if `data_type` is not 'int64' + 'granularity': '' + + # only if `data_type` is 'int64' + 'range': { + 'start': , + 'end': , + 'interval': , + } + }, + + # auto-refresh options + enable_refresh=, + refresh_interval_minutes=, + max_staleness='', + + # additional options + description='', + labels={'': '', ...}, + hours_to_expiration=, + kms_key_name='', +) }} + +select * from {{ ref('my_base_table') }} +``` + + + +Many of these parameters correspond to their table counterparts and have been linked above. +The set of parameters which are unique to materialized views covers auto-refresh functionality, which is covered [below](#auto-refresh). + +Find more information about these parameters in the BigQuery docs: +- [CREATE MATERIALIZED VIEW statement](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_materialized_view_statement) +- [materialized_view_option_list](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#materialized_view_option_list) + +### Auto-refresh + +| Parameter | Type | Default | Change Monitoring Support | +|-------------------------------|----------|---------|---------------------------| +| `enable_refresh` | BOOLEAN | `True` | ALTER | +| `max_staleness` (in Preview) | INTERVAL | `None` | ALTER | +| `refresh_interval_minutes` | FLOAT | `30` | ALTER | + +BigQuery supports [automatic refresh](https://cloud.google.com/bigquery/docs/materialized-views-manage#automatic_refresh) configuration for materialized views. +By default, a materialized view will automatically refresh within 5 minutes of changes in the base table, but no more frequently than every 30 minutes. +BigQuery only officially supports configuration of the frequency (the "30 minutes" part); +however, there is a feature in preview that allows for configuration of the staleness (the "5 minutes" part). +dbt will monitor these parameters for changes and apply them using an `ALTER` statement. + +Find more information about these parameters in the BigQuery docs: +- [materialized_view_option_list](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#materialized_view_option_list) +- [max_staleness](https://cloud.google.com/bigquery/docs/materialized-views-create#max_staleness) + +### Limitations + +As with most data platforms, there are limitations associated with materialized views. Some worth noting include: + +- Materialized view SQL has a [limited feature set](https://cloud.google.com/bigquery/docs/materialized-views-create#supported-mvs) +- Materialized view SQL cannot be updated; the materialized view must go through a `--full-refresh` (DROP/CREATE) +- The `partition_by` clause on a materialized view must match that of the underlying base table +- While materialized views can have descriptions, materialized view *columns* cannot +- Recreating/dropping the base table requires recreating/dropping the materialized view + +Find more information about materialized view limitations in Google's BigQuery [docs](https://cloud.google.com/bigquery/docs/materialized-views-intro#limitations). + + From 2ccbc79b386aa9193357cb0ccbf643f4f55a1f19 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Mon, 4 Dec 2023 17:27:58 -0500 Subject: [PATCH 02/37] add dynamic table configuration for snowflake --- .../resource-configs/snowflake-configs.md | 85 ++++++++++--------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index 30c7966ec68..6c7ba86d353 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -346,82 +346,87 @@ In the configuration format for the model SQL file: ## Dynamic tables -The Snowflake adapter supports [dynamic tables](https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table). +The Snowflake adapter supports [dynamic tables](https://docs.snowflake.com/en/user-guide/dynamic-tables-about). This materialization is specific to Snowflake, which means that any model configuration that would normally come along for the ride from `dbt-core` (e.g. as with a `view`) may not be available for dynamic tables. This gap will decrease in future patches and versions. While this materialization is specific to Snowflake, it very much follows the implementation of [materialized views](/docs/build/materializations#Materialized-View). In particular, dynamic tables have access to the `on_configuration_change` setting. -There are also some limitations that we hope to address in the next version. +Dynamic tables are supported with the following configuration parameters: -### Parameters +| Parameter | Type | Required | Default | Change Monitoring Support | Reference | +|---------------------------|----------|----------|-----------|---------------------------|----------------------------------------------| +| `on_configuration_change` | STRING | NO | `'apply'` | N/A | | +| `target_lag` | STRING | YES | | ALTER | [Target lag](#target-lag) | +| `snowflake_warehouse` | STRING | YES | | ALTER | [Warehouse](#configuring-virtual-warehouses) | -Dynamic tables in `dbt-snowflake` require the following parameters: -- `target_lag` -- `snowflake_warehouse` -- `on_configuration_change` +#### Sample model file: -To learn more about each parameter and what values it can take, see -the Snowflake docs page: [`CREATE DYNAMIC TABLE: Parameters`](https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table). - -### Usage - -You can create a dynamic table by editing _one_ of these files: - -- the SQL file for your model -- the `dbt_project.yml` configuration file - -The following examples create a dynamic table: - - + ```sql {{ config( - materialized = 'dynamic_table', - snowflake_warehouse = 'snowflake_warehouse', - target_lag = '10 minutes', + materialized='dynamic_table', + on_configuration_change='', + target_lag='< { seconds | minutes | hours | days } | DOWNSTREAM>', + snowflake_warehouse='', ) }} + +select * from {{ ref('my_base_table') }} ``` +#### Sample project file: + ```yaml models: path: materialized: dynamic_table - snowflake_warehouse: snowflake_warehouse - target_lag: '10 minutes' + on_configuration_change: '' + snowflake_warehouse: '' + target_lag: '< { seconds | minutes | hours | days } | DOWNSTREAM>' ``` -### Monitored configuration changes +Find more information about these parameters in the Snowflake docs: +- [CREATE DYNAMIC TABLE](https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table) -The settings below are monitored for changes applicable to `on_configuration_change`. +### Target lag -#### Target lag +Snowflake allows two configuration scenarios for scheduling automatic refreshes: time-based and dependency-based. +For time-based automatic refreshes, provide a value of the form ` { seconds | minutes | hours | days }`. +For example, if the dynamic table needs to be updated every 30 minutes, use `target_lag='30 minutes'`. +However, for scenarios where the referenced objects are themselves dynamic tables, it might be desirable to refresh +the dynamic table whenever the underlying dynamic table is refreshed. In this scenario, use `target_lag='downstream'`. +This allows for refresh schedules to be controlled once, at the source, instead of at each layer. -Changes to `target_lag` can be applied by running an `ALTER` statement. Refreshing is essentially -always on for dynamic tables; this setting changes how frequently the dynamic table is updated. +### Limitations -#### Warehouse +As with materialized views on most data platforms, there are limitations associated with dynamic tables. Some worth noting include: -Changes to `snowflake_warehouse` can be applied via an `ALTER` statement. +- Dynamic table SQL has a [limited feature set](https://docs.snowflake.com/en/user-guide/dynamic-tables-tasks-create#query-constructs-not-currently-supported-in-dynamic-tables) +- Dynamic table SQL cannot be updated; the dynamic table must go through a `--full-refresh` (DROP/CREATE) +- Dynamic tables cannot be downstream from: materialized views, external tables, streams +- Dynamic tables cannot reference a view that is downstream from another dynamic table -### Limitations +Find more information about dynamic table limitations in Snowflake's [docs](https://docs.snowflake.com/en/user-guide/dynamic-tables-tasks-create#dynamic-table-limitations-and-supported-functions). + + #### Changing materialization to and from "dynamic_table" -Swapping an already materialized model to be a dynamic table and vice versa. -The workaround is manually dropping the existing materialization in the data warehouse prior to calling `dbt run`. -Normally, re-running with the `--full-refresh` flag would resolve this, but not in this case. -This would only need to be done once as the existing object would then be a dynamic table. +Version `1.6.x` does not support altering the materialization from a non-dynamic table be a dynamic table and vice versa. +Re-running with the `--full-refresh` does not resolve this either. +The workaround is manually dropping the existing model in the warehouse prior to calling `dbt run`. +This only needs to be done once for the conversion. For example, assume for the example model below, `my_model`, has already been materialized to the underlying data platform via `dbt run`. -If the user changes the model's config to `materialized="dynamic_table"`, they will get an error. +If the model config is updated to `materialized="dynamic_table"`, dbt will return an error. The workaround is to execute `DROP TABLE my_model` on the data warehouse before trying the model again. @@ -429,7 +434,7 @@ The workaround is to execute `DROP TABLE my_model` on the data warehouse before ```yaml {{ config( - materialized="table" # or any model type eg view, incremental + materialized="table" # or any model type (e.g. view, incremental) ) }} ``` @@ -437,3 +442,5 @@ The workaround is to execute `DROP TABLE my_model` on the data warehouse before + + From bf57f5102375efbb1cddd19bb11c519eaddf0cab Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 5 Dec 2023 12:31:58 -0500 Subject: [PATCH 03/37] add materialized view configuration for redshift --- .../resource-configs/redshift-configs.md | 84 ++++++++++++++----- 1 file changed, 64 insertions(+), 20 deletions(-) diff --git a/website/docs/reference/resource-configs/redshift-configs.md b/website/docs/reference/resource-configs/redshift-configs.md index 9bd127a1e1a..ea0e4cad7b5 100644 --- a/website/docs/reference/resource-configs/redshift-configs.md +++ b/website/docs/reference/resource-configs/redshift-configs.md @@ -111,40 +111,82 @@ models: ## Materialized views -The Redshift adapter supports [materialized views](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-overview.html). -Redshift-specific configuration includes the typical `dist`, `sort_type`, `sort`, and `backup`. -For materialized views, there is also the `auto_refresh` setting, which allows Redshift to [automatically refresh](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-refresh.html) the materialized view for you. -The remaining configuration follows the general [materialized view](/docs/build/materializations#Materialized-View) configuration. -There are also some limitations that we hope to address in the next version. +The Redshift adapter supports [materialized views](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-overview.html) +with the following configuration parameters: -### Monitored configuration changes +| Parameter | Type | Default | Change Monitoring Support | Reference | +|----------------|--------------|------------------------|---------------------------|-------------------------------------------------| +| `dist` | STRING | `'EVEN'` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| `sort` | LIST[STRING] | `None` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| `sort_type` | STRING | `'AUTO'` if no `sort` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| | | `'COMPOUND'` if `sort` | | | +| `auto_refresh` | BOOLEAN | `False` | ALTER | [Auto refresh](#auto-refresh) | +| `backup` | BOOLEAN | `True` | N/A | [Backup](#backup) | -The settings below are monitored for changes applicable to `on_configuration_change`. +#### Sample model file: -#### Dist + -Changes to `dist` will result in a full refresh of the existing materialized view (applied at the time of the next `dbt run` of the model). Redshift requires a materialized view to be -dropped and recreated to apply a change to the `distkey` or `diststyle`. +```sql +{{ config( + materialized='materialized_view', + dist='{ ALL | AUTO | EVEN | }', + sort=['', ...], + sort_type='{ AUTO | COMPOUND | INTERLEAVED }' + auto_refresh=, + backup=, +) }} + +select * from {{ ref('my_base_table') }} +``` + + + +Many of these parameters correspond to their table counterparts and have been linked above. +The set of parameters which are unique to materialized views covers auto-refresh and backup functionality, which is covered below. + +Find more information about these parameters in the Redshift docs: +- [CREATE MATERIALIZED VIEW](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html) + +#### Auto-refresh -#### Sort type, sort +| Parameter | Type | Default | Change Monitoring Support | +|----------------|---------|---------|---------------------------| +| `auto_refresh` | BOOLEAN | `False` | ALTER | -Changes to `sort_type` or `sort` will result in a full refresh. Redshift requires a materialized -view to be dropped and recreated to apply a change to the `sortkey` or `sortstyle`. +Redshift supports [automatic refresh](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-refresh.html#materialized-view-auto-refresh) configuration for materialized views. +By default, a materialized view will not automatically refresh. +dbt will monitor this parameter for changes and apply them using an `ALTER` statement. + +Find more information about this parameter in the Redshift docs: +- [Parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) #### Backup -Changes to `backup` will result in a full refresh. Redshift requires a materialized -view to be dropped and recreated to apply a change to the `backup` setting. +| Parameter | Type | Default | Change Monitoring Support | +|-----------|---------|---------|---------------------------| +| `backup` | BOOLEAN | `True` | N/A | -#### Auto refresh +Redshift supports [backup](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html) configuration of clusters at the object level. +This parameter identifies if the materialized view should be backed up as part of the cluster snapshot. +By default, a materialized view will be backed up during a cluster snapshot. +dbt cannot monitor this parameter as it is not queryable within Redshift. +If the value is changed, the materialized view will need to go through a `--full-refresh` in order to set it. -The `auto_refresh` setting can be updated via an `ALTER` statement. This setting effectively toggles -automatic refreshes on or off. The default setting for this config is off (`False`). If this -is the only configuration change for the materialized view, dbt will choose to apply -an `ALTER` statement instead of issuing a full refresh, +Find more information about this parameter in the Redshift docs: +- [Parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) ### Limitations +As with most data platforms, there are limitations associated with materialized views. Some worth noting include: + +- Materialized views cannot reference: views, temporary tables, user defined functions, late-binding tables +- Auto-refresh cannot be used if the materialized view references: mutable functions, external schemas, another materialized view + +Find more information about materialized view limitations in Redshift's [docs](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-limitations). + + + #### Changing materialization from "materialized_view" to "table" or "view" Swapping a materialized view to a table or view is not supported. @@ -157,3 +199,5 @@ If the user changes the model's config to `materialized="table"`, they will get The workaround is to execute `DROP MATERIALIZED VIEW my_mv CASCADE` on the data warehouse before trying the model again. + + From 406b40851a34268a194b2ae0e15ca5c180c09e92 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 5 Dec 2023 13:10:15 -0500 Subject: [PATCH 04/37] add materialized view configuration for postgres --- .../resource-configs/postgres-configs.md | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index 97a695ee12e..f9bd4e11cbc 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -108,21 +108,43 @@ models: ## Materialized views -The Postgres adapter supports [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html). -Indexes are the only configuration that is specific to `dbt-postgres`. -The remaining configuration follows the general [materialized view](/docs/build/materializations#materialized-view) configuration. -There are also some limitations that we hope to address in the next version. +The Postgres adapter supports [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html) +with the following configuration parameters: -### Monitored configuration changes +| Parameter | Type | Required | Default | Change Monitoring Support | Reference | +|---------------------------|------------|----------|-----------|---------------------------|---------------------| +| `on_configuration_change` | STRING | NO | `'apply'` | N/A | | +| `indexes` | LIST[DICT] | NO | | ALTER | [Indexes](#indexes) | -The settings below are monitored for changes applicable to `on_configuration_change`. +#### Sample model file: -#### Indexes + -Index changes (`CREATE`, `DROP`) can be applied without the need to rebuild the materialized view. -This differs from a table model, where the table needs to be dropped and re-created to update the indexes. -If the `indexes` portion of the `config` block is updated, the changes will be detected and applied -directly to the materialized view in place. +```sql +{{ config( + materialized='materialized_view', + on_configuration_change='{ apply | continue | fail }' + indexes=[ + { + 'columns': ['', ...], + 'unique': }, + 'type': '{ HASH | B-TREE | GIST | SP-GIST | GIN | BRIN }', + ] +) }} + +select * from {{ ref('my_base_table') }} +``` + + + +The `indexes` parameter corresponds to that of a table, as linked above. +It's worth noting that, unlike with tables, dbt will monitor this parameter for changes and apply the changes without dropping the materialized view. +This happens via a `DROP/CREATE` of the indexes, which could be thought of as a `ALTER` of the materialized view. + +Find more information about materialized view parameters in the Postgres docs: +- [CREATE MATERIALIZED VIEW](https://www.postgresql.org/docs/current/sql-creatematerializedview.html) + + ### Limitations @@ -138,3 +160,5 @@ If the user changes the model's config to `materialized="materialized_view"`, th The solution is to execute `DROP TABLE my_model` on the data warehouse before trying the model again. + + From 99ba899848b319af3943c0b526ff6754de21bd29 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 5 Dec 2023 13:16:15 -0500 Subject: [PATCH 05/37] add required column --- .../resource-configs/redshift-configs.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/website/docs/reference/resource-configs/redshift-configs.md b/website/docs/reference/resource-configs/redshift-configs.md index ea0e4cad7b5..635fecc5e02 100644 --- a/website/docs/reference/resource-configs/redshift-configs.md +++ b/website/docs/reference/resource-configs/redshift-configs.md @@ -114,14 +114,14 @@ models: The Redshift adapter supports [materialized views](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-overview.html) with the following configuration parameters: -| Parameter | Type | Default | Change Monitoring Support | Reference | -|----------------|--------------|------------------------|---------------------------|-------------------------------------------------| -| `dist` | STRING | `'EVEN'` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| `sort` | LIST[STRING] | `None` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| `sort_type` | STRING | `'AUTO'` if no `sort` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| | | `'COMPOUND'` if `sort` | | | -| `auto_refresh` | BOOLEAN | `False` | ALTER | [Auto refresh](#auto-refresh) | -| `backup` | BOOLEAN | `True` | N/A | [Backup](#backup) | +| Parameter | Type | Required | Default | Change Monitoring Support | Reference | +|----------------|--------------|----------|------------------------|---------------------------|-------------------------------------------------| +| `dist` | STRING | NO | `'EVEN'` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| `sort` | LIST[STRING] | NO | | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| `sort_type` | STRING | NO | `'AUTO'` if no `sort` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| | | | `'COMPOUND'` if `sort` | | | +| `auto_refresh` | BOOLEAN | NO | `False` | ALTER | [Auto refresh](#auto-refresh) | +| `backup` | BOOLEAN | HO | `True` | N/A | [Backup](#backup) | #### Sample model file: @@ -150,9 +150,9 @@ Find more information about these parameters in the Redshift docs: #### Auto-refresh -| Parameter | Type | Default | Change Monitoring Support | -|----------------|---------|---------|---------------------------| -| `auto_refresh` | BOOLEAN | `False` | ALTER | +| Parameter | Type | Required | Default | Change Monitoring Support | +|----------------|---------|----------|---------|---------------------------| +| `auto_refresh` | BOOLEAN | NO | `False` | ALTER | Redshift supports [automatic refresh](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-refresh.html#materialized-view-auto-refresh) configuration for materialized views. By default, a materialized view will not automatically refresh. @@ -163,9 +163,9 @@ Find more information about this parameter in the Redshift docs: #### Backup -| Parameter | Type | Default | Change Monitoring Support | -|-----------|---------|---------|---------------------------| -| `backup` | BOOLEAN | `True` | N/A | +| Parameter | Type | Required | Default | Change Monitoring Support | +|-----------|---------|----------|---------|---------------------------| +| `backup` | BOOLEAN | NO | `True` | N/A | Redshift supports [backup](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html) configuration of clusters at the object level. This parameter identifies if the materialized view should be backed up as part of the cluster snapshot. From 0256471955d8480994f515a9e98092317939ea8d Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 5 Dec 2023 13:19:21 -0500 Subject: [PATCH 06/37] add required column --- .../resource-configs/bigquery-configs.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/website/docs/reference/resource-configs/bigquery-configs.md b/website/docs/reference/resource-configs/bigquery-configs.md index eabefe90d4e..9d2b4abed75 100644 --- a/website/docs/reference/resource-configs/bigquery-configs.md +++ b/website/docs/reference/resource-configs/bigquery-configs.md @@ -725,17 +725,17 @@ The `grant_access_to` config is not thread-safe when multiple views need to be a The BigQuery adapter supports [materialized views](https://cloud.google.com/bigquery/docs/materialized-views-intro) with the following configuration parameters: -| Parameter | Type | Default | Change Monitoring Support | Reference | -|------------------------------|----------------------|---------|---------------------------|--------------------------------------------------| -| `cluster_by` | LIST[STRING] | `None` | DROP/CREATE | [Clustering](#clustering-clause) | -| `partition_by` | DICT | `None` | DROP/CREATE | [Partitioning](#partition-clause) | -| `enable_refresh` | BOOLEAN | `True` | ALTER | [Auto-refresh](#auto-refresh) | -| `refresh_interval_minutes` | FLOAT | `30` | ALTER | [Auto-refresh](#auto-refresh) | -| `max_staleness` (in Preview) | INTERVAL | `None` | ALTER | [Auto-refresh](#auto-refresh) | -| `description` | STRING | `None` | ALTER | | -| `labels` | DICT[STRING, STRING] | `None` | ALTER | [Labels](#specifying-labels) | -| `hours_to_expiration` | INTEGER | `None` | ALTER | [Table expiration](controlling-table-expiration) | -| `kms_key_name` | STRING | `None` | ALTER | [KMS encryption](#using-kms-encryption) | +| Parameter | Type | Required | Default | Change Monitoring Support | Reference | +|------------------------------|----------------------|----------|---------|---------------------------|--------------------------------------------------| +| `cluster_by` | LIST[STRING] | NO | | DROP/CREATE | [Clustering](#clustering-clause) | +| `partition_by` | DICT | NO | | DROP/CREATE | [Partitioning](#partition-clause) | +| `enable_refresh` | BOOLEAN | NO | `True` | ALTER | [Auto-refresh](#auto-refresh) | +| `refresh_interval_minutes` | FLOAT | NO | `30` | ALTER | [Auto-refresh](#auto-refresh) | +| `max_staleness` (in Preview) | INTERVAL | NO | | ALTER | [Auto-refresh](#auto-refresh) | +| `description` | STRING | NO | | ALTER | | +| `labels` | DICT[STRING, STRING] | NO | | ALTER | [Labels](#specifying-labels) | +| `hours_to_expiration` | INTEGER | NO | | ALTER | [Table expiration](controlling-table-expiration) | +| `kms_key_name` | STRING | NO | | ALTER | [KMS encryption](#using-kms-encryption) | #### Sample model file: @@ -786,11 +786,11 @@ Find more information about these parameters in the BigQuery docs: ### Auto-refresh -| Parameter | Type | Default | Change Monitoring Support | -|-------------------------------|----------|---------|---------------------------| -| `enable_refresh` | BOOLEAN | `True` | ALTER | -| `max_staleness` (in Preview) | INTERVAL | `None` | ALTER | -| `refresh_interval_minutes` | FLOAT | `30` | ALTER | +| Parameter | Type | Required | Default | Change Monitoring Support | +|-------------------------------|----------|----------|---------|---------------------------| +| `enable_refresh` | BOOLEAN | NO | `True` | ALTER | +| `refresh_interval_minutes` | FLOAT | NO | `30` | ALTER | +| `max_staleness` (in Preview) | INTERVAL | NO | | ALTER | BigQuery supports [automatic refresh](https://cloud.google.com/bigquery/docs/materialized-views-manage#automatic_refresh) configuration for materialized views. By default, a materialized view will automatically refresh within 5 minutes of changes in the base table, but no more frequently than every 30 minutes. From 88d681930b0ed629ed3c5e464cc65ec692d4d036 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 5 Dec 2023 13:23:01 -0500 Subject: [PATCH 07/37] add on_configuration_change --- .../resource-configs/bigquery-configs.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/website/docs/reference/resource-configs/bigquery-configs.md b/website/docs/reference/resource-configs/bigquery-configs.md index 9d2b4abed75..97acb73ce33 100644 --- a/website/docs/reference/resource-configs/bigquery-configs.md +++ b/website/docs/reference/resource-configs/bigquery-configs.md @@ -725,17 +725,18 @@ The `grant_access_to` config is not thread-safe when multiple views need to be a The BigQuery adapter supports [materialized views](https://cloud.google.com/bigquery/docs/materialized-views-intro) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | Reference | -|------------------------------|----------------------|----------|---------|---------------------------|--------------------------------------------------| -| `cluster_by` | LIST[STRING] | NO | | DROP/CREATE | [Clustering](#clustering-clause) | -| `partition_by` | DICT | NO | | DROP/CREATE | [Partitioning](#partition-clause) | -| `enable_refresh` | BOOLEAN | NO | `True` | ALTER | [Auto-refresh](#auto-refresh) | -| `refresh_interval_minutes` | FLOAT | NO | `30` | ALTER | [Auto-refresh](#auto-refresh) | -| `max_staleness` (in Preview) | INTERVAL | NO | | ALTER | [Auto-refresh](#auto-refresh) | -| `description` | STRING | NO | | ALTER | | -| `labels` | DICT[STRING, STRING] | NO | | ALTER | [Labels](#specifying-labels) | -| `hours_to_expiration` | INTEGER | NO | | ALTER | [Table expiration](controlling-table-expiration) | -| `kms_key_name` | STRING | NO | | ALTER | [KMS encryption](#using-kms-encryption) | +| Parameter | Type | Required | Default | Change Monitoring Support | Reference | +|------------------------------|----------------------|----------|-----------|---------------------------|--------------------------------------------------| +| `on_configuration_change` | STRING | NO | `'apply'` | N/A | | +| `cluster_by` | LIST[STRING] | NO | | DROP/CREATE | [Clustering](#clustering-clause) | +| `partition_by` | DICT | NO | | DROP/CREATE | [Partitioning](#partition-clause) | +| `enable_refresh` | BOOLEAN | NO | `True` | ALTER | [Auto-refresh](#auto-refresh) | +| `refresh_interval_minutes` | FLOAT | NO | `30` | ALTER | [Auto-refresh](#auto-refresh) | +| `max_staleness` (in Preview) | INTERVAL | NO | | ALTER | [Auto-refresh](#auto-refresh) | +| `description` | STRING | NO | | ALTER | | +| `labels` | DICT[STRING, STRING] | NO | | ALTER | [Labels](#specifying-labels) | +| `hours_to_expiration` | INTEGER | NO | | ALTER | [Table expiration](controlling-table-expiration) | +| `kms_key_name` | STRING | NO | | ALTER | [KMS encryption](#using-kms-encryption) | #### Sample model file: @@ -744,6 +745,7 @@ with the following configuration parameters: ```sql {{ config( materialized='materialized_view', + on_configuration_change='{ apply | continue | fail }' cluster_by=['', ...], partition_by={ 'field': '', From bd764ceb01701d9d36ded64b4ae02843ac49a23c Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 5 Dec 2023 13:24:48 -0500 Subject: [PATCH 08/37] add on_configuration_change --- .../resource-configs/redshift-configs.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/website/docs/reference/resource-configs/redshift-configs.md b/website/docs/reference/resource-configs/redshift-configs.md index 635fecc5e02..8c9b015ded3 100644 --- a/website/docs/reference/resource-configs/redshift-configs.md +++ b/website/docs/reference/resource-configs/redshift-configs.md @@ -114,14 +114,15 @@ models: The Redshift adapter supports [materialized views](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-overview.html) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | Reference | -|----------------|--------------|----------|------------------------|---------------------------|-------------------------------------------------| -| `dist` | STRING | NO | `'EVEN'` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| `sort` | LIST[STRING] | NO | | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| `sort_type` | STRING | NO | `'AUTO'` if no `sort` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| | | | `'COMPOUND'` if `sort` | | | -| `auto_refresh` | BOOLEAN | NO | `False` | ALTER | [Auto refresh](#auto-refresh) | -| `backup` | BOOLEAN | HO | `True` | N/A | [Backup](#backup) | +| Parameter | Type | Required | Default | Change Monitoring Support | Reference | +|---------------------------|--------------|----------|------------------------|---------------------------|-------------------------------------------------| +| `on_configuration_change` | STRING | NO | `'apply'` | N/A | | +| `dist` | STRING | NO | `'EVEN'` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| `sort` | LIST[STRING] | NO | | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| `sort_type` | STRING | NO | `'AUTO'` if no `sort` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | +| | | | `'COMPOUND'` if `sort` | | | +| `auto_refresh` | BOOLEAN | NO | `False` | ALTER | [Auto refresh](#auto-refresh) | +| `backup` | BOOLEAN | HO | `True` | N/A | [Backup](#backup) | #### Sample model file: @@ -130,6 +131,7 @@ with the following configuration parameters: ```sql {{ config( materialized='materialized_view', + on_configuration_change='{ apply | continue | fail }' dist='{ ALL | AUTO | EVEN | }', sort=['', ...], sort_type='{ AUTO | COMPOUND | INTERLEAVED }' From 3ca806c8e56a14ebf3c470a19bf625b8342a8379 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 5 Dec 2023 13:25:57 -0500 Subject: [PATCH 09/37] add on_configuration_change --- website/docs/reference/resource-configs/snowflake-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index 6c7ba86d353..39dd4430c4c 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -368,7 +368,7 @@ Dynamic tables are supported with the following configuration parameters: ```sql {{ config( materialized='dynamic_table', - on_configuration_change='', + on_configuration_change='{ apply | continue | fail }', target_lag='< { seconds | minutes | hours | days } | DOWNSTREAM>', snowflake_warehouse='', ) }} From 55d37b71142f270cff5cdce03b74d528f31e7f9b Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:35:28 -0500 Subject: [PATCH 10/37] Apply suggestions from code review --- .../resource-configs/redshift-configs.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/website/docs/reference/resource-configs/redshift-configs.md b/website/docs/reference/resource-configs/redshift-configs.md index 8c9b015ded3..0e079453ec6 100644 --- a/website/docs/reference/resource-configs/redshift-configs.md +++ b/website/docs/reference/resource-configs/redshift-configs.md @@ -145,10 +145,9 @@ select * from {{ ref('my_base_table') }} Many of these parameters correspond to their table counterparts and have been linked above. -The set of parameters which are unique to materialized views covers auto-refresh and backup functionality, which is covered below. +The parameters unique to materialized views are the auto-refresh and backup functionality, which are covered below. -Find more information about these parameters in the Redshift docs: -- [CREATE MATERIALIZED VIEW](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html) +Find more information about the [CREATE MATERIALIZED VIEW](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html) parameters in the Redshift docs. #### Auto-refresh @@ -157,11 +156,10 @@ Find more information about these parameters in the Redshift docs: | `auto_refresh` | BOOLEAN | NO | `False` | ALTER | Redshift supports [automatic refresh](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-refresh.html#materialized-view-auto-refresh) configuration for materialized views. -By default, a materialized view will not automatically refresh. -dbt will monitor this parameter for changes and apply them using an `ALTER` statement. +By default, a materialized view does not automatically refresh. +dbt monitors this parameter for changes and applies them using an `ALTER` statement. -Find more information about this parameter in the Redshift docs: -- [Parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) +Find more information about the [parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) in the Redshift docs. #### Backup @@ -175,15 +173,14 @@ By default, a materialized view will be backed up during a cluster snapshot. dbt cannot monitor this parameter as it is not queryable within Redshift. If the value is changed, the materialized view will need to go through a `--full-refresh` in order to set it. -Find more information about this parameter in the Redshift docs: -- [Parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) +Find more information about the [parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) in the Redshift docs. ### Limitations As with most data platforms, there are limitations associated with materialized views. Some worth noting include: -- Materialized views cannot reference: views, temporary tables, user defined functions, late-binding tables -- Auto-refresh cannot be used if the materialized view references: mutable functions, external schemas, another materialized view +- Materialized views cannot reference views, temporary tables, user-defined functions, or late-binding tables. +- Auto-refresh cannot be used if the materialized view references mutable functions, external schemas, or another materialized view. Find more information about materialized view limitations in Redshift's [docs](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-limitations). From 54b29418138dfae2e7c153a83a3b1e8b9d1ae26c Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:36:24 -0500 Subject: [PATCH 11/37] Update website/docs/reference/resource-configs/postgres-configs.md Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --- website/docs/reference/resource-configs/postgres-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index f9bd4e11cbc..855c17d8883 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -127,7 +127,7 @@ with the following configuration parameters: indexes=[ { 'columns': ['', ...], - 'unique': }, + 'unique': , 'type': '{ HASH | B-TREE | GIST | SP-GIST | GIN | BRIN }', ] ) }} From 964e12563623525ccffc3a52ab6b2b2795f957f2 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:36:39 -0500 Subject: [PATCH 12/37] Update website/docs/reference/resource-configs/postgres-configs.md Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --- website/docs/reference/resource-configs/postgres-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index 855c17d8883..109bd595bb9 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -129,7 +129,7 @@ with the following configuration parameters: 'columns': ['', ...], 'unique': , 'type': '{ HASH | B-TREE | GIST | SP-GIST | GIN | BRIN }', - ] + }] ) }} select * from {{ ref('my_base_table') }} From a6f69eb551ce902cef2a9191c3bef052e98e664d Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:47:36 -0500 Subject: [PATCH 13/37] Update website/docs/reference/resource-configs/snowflake-configs.md Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --- website/docs/reference/resource-configs/snowflake-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index 39dd4430c4c..900860ea287 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -357,7 +357,7 @@ Dynamic tables are supported with the following configuration parameters: | Parameter | Type | Required | Default | Change Monitoring Support | Reference | |---------------------------|----------|----------|-----------|---------------------------|----------------------------------------------| -| `on_configuration_change` | STRING | NO | `'apply'` | N/A | | +| `on_configuration_change` | STRING | NO | `apply` | N/A | | | `target_lag` | STRING | YES | | ALTER | [Target lag](#target-lag) | | `snowflake_warehouse` | STRING | YES | | ALTER | [Warehouse](#configuring-virtual-warehouses) | From 0d4dd63ad767fcb480ca39f9ee8d2999e920a1d1 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 6 Dec 2023 21:40:59 -0500 Subject: [PATCH 14/37] incorporate style standards --- .../resource-configs/postgres-configs.md | 86 +++++++++++++++---- 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index 109bd595bb9..98ef0d56d27 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -111,32 +111,86 @@ models: The Postgres adapter supports [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | Reference | -|---------------------------|------------|----------|-----------|---------------------------|---------------------| -| `on_configuration_change` | STRING | NO | `'apply'` | N/A | | -| `indexes` | LIST[DICT] | NO | | ALTER | [Indexes](#indexes) | +| Parameter | Type | Required | Default | Change Monitoring Support | +|---------------------------|------------------|----------|---------|---------------------------| +| `on_configuration_change` | | no | `apply` | n/a | +| [`indexes`](#indexes) | [{}] | no | `none` | alter | + + + + -#### Sample model file: + - +```yaml +models: + [](/reference/resource-configs/resource-path): + [+](/reference/resource-configs/plus-prefix)[materialized](/reference/resource-configs/materialized): materialized_view + [+](/reference/resource-configs/plus-prefix)on_configuration_change: apply | continue | fail + [+](/reference/resource-configs/plus-prefix)[indexes](#indexes): + - columns: [] + unique: true | false + type: hash | btree +``` -```sql + + + + + + + + +```yaml +version: 2 + +models: + - name: [] + config: + [materialized](/reference/resource-configs/materialized): materialized_view + on_configuration_change: apply | continue | fail + [indexes](#indexes): + - columns: [] + unique: true | false + type: hash | btree +``` + + + + + + + + + +```jinja {{ config( - materialized='materialized_view', - on_configuration_change='{ apply | continue | fail }' - indexes=[ + [materialized](/reference/resource-configs/materialized)="materialized_view", + on_configuration_change="apply" | "continue" | "fail" + [indexes](#indexes)=[ { - 'columns': ['', ...], - 'unique': , - 'type': '{ HASH | B-TREE | GIST | SP-GIST | GIN | BRIN }', - }] + "columns": [""], + "unique": true | false, + "type": "hash" | "btree", + } + ] ) }} - -select * from {{ ref('my_base_table') }} ``` + + + + The `indexes` parameter corresponds to that of a table, as linked above. It's worth noting that, unlike with tables, dbt will monitor this parameter for changes and apply the changes without dropping the materialized view. This happens via a `DROP/CREATE` of the indexes, which could be thought of as a `ALTER` of the materialized view. From bd6c4fc146678f0aeae9a9e15f15b2591cdd4bf8 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 6 Dec 2023 22:08:42 -0500 Subject: [PATCH 15/37] incorporate style standards --- website/docs/reference/resource-configs/postgres-configs.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index 98ef0d56d27..d5960231c66 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -145,6 +145,7 @@ models: + @@ -167,6 +168,7 @@ models: + @@ -174,7 +176,7 @@ models: ```jinja {{ config( [materialized](/reference/resource-configs/materialized)="materialized_view", - on_configuration_change="apply" | "continue" | "fail" + on_configuration_change="apply" | "continue" | "fail", [indexes](#indexes)=[ { "columns": [""], From 5e904f13d54f8228f2c89848f8ca8a0440b5f026 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 6 Dec 2023 22:34:56 -0500 Subject: [PATCH 16/37] remove tabs to test build --- .../resource-configs/postgres-configs.md | 77 ------------------- 1 file changed, 77 deletions(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index d5960231c66..c4d60ba905d 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -116,83 +116,6 @@ with the following configuration parameters: | `on_configuration_change` | | no | `apply` | n/a | | [`indexes`](#indexes) | [{}] | no | `none` | alter | - - - - - - -```yaml -models: - [](/reference/resource-configs/resource-path): - [+](/reference/resource-configs/plus-prefix)[materialized](/reference/resource-configs/materialized): materialized_view - [+](/reference/resource-configs/plus-prefix)on_configuration_change: apply | continue | fail - [+](/reference/resource-configs/plus-prefix)[indexes](#indexes): - - columns: [] - unique: true | false - type: hash | btree -``` - - - - - - - - - - -```yaml -version: 2 - -models: - - name: [] - config: - [materialized](/reference/resource-configs/materialized): materialized_view - on_configuration_change: apply | continue | fail - [indexes](#indexes): - - columns: [] - unique: true | false - type: hash | btree -``` - - - - - - - - - - -```jinja -{{ config( - [materialized](/reference/resource-configs/materialized)="materialized_view", - on_configuration_change="apply" | "continue" | "fail", - [indexes](#indexes)=[ - { - "columns": [""], - "unique": true | false, - "type": "hash" | "btree", - } - ] -) }} -``` - - - - - - - The `indexes` parameter corresponds to that of a table, as linked above. It's worth noting that, unlike with tables, dbt will monitor this parameter for changes and apply the changes without dropping the materialized view. This happens via a `DROP/CREATE` of the indexes, which could be thought of as a `ALTER` of the materialized view. From 76df337ea6acb03da8fcd1ab313deb6ed0e4e4c3 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 6 Dec 2023 22:43:16 -0500 Subject: [PATCH 17/37] remove quotes to test build --- website/docs/reference/resource-configs/postgres-configs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index c4d60ba905d..de084f9eb02 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -111,10 +111,10 @@ models: The Postgres adapter supports [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | -|---------------------------|------------------|----------|---------|---------------------------| +| Parameter | Type | Required | Default | Change Monitoring Support | +|-------------------------|------------------|----------|---------|---------------------------| | `on_configuration_change` | | no | `apply` | n/a | -| [`indexes`](#indexes) | [{}] | no | `none` | alter | +| [indexes](#indexes) | [{}] | no | `none` | alter | The `indexes` parameter corresponds to that of a table, as linked above. It's worth noting that, unlike with tables, dbt will monitor this parameter for changes and apply the changes without dropping the materialized view. From b744ea85e0b24fcbad5a73d4c2fc4d8deba1e206 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 6 Dec 2023 22:53:13 -0500 Subject: [PATCH 18/37] test build --- .../reference/resource-configs/postgres-configs.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index de084f9eb02..e230641c37a 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -111,10 +111,10 @@ models: The Postgres adapter supports [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | -|-------------------------|------------------|----------|---------|---------------------------| -| `on_configuration_change` | | no | `apply` | n/a | -| [indexes](#indexes) | [{}] | no | `none` | alter | +| Parameter | Type | Required | Default | Change Monitoring Support | +|---------------------------|--------------|----------|---------|---------------------------| +| `on_configuration_change` | | no | `apply` | n/a | +| [indexes](#indexes) | | no | `none` | alter | The `indexes` parameter corresponds to that of a table, as linked above. It's worth noting that, unlike with tables, dbt will monitor this parameter for changes and apply the changes without dropping the materialized view. @@ -123,7 +123,7 @@ This happens via a `DROP/CREATE` of the indexes, which could be thought of as a Find more information about materialized view parameters in the Postgres docs: - [CREATE MATERIALIZED VIEW](https://www.postgresql.org/docs/current/sql-creatematerializedview.html) - + ### Limitations From fb00255b8588c8df6a324f00780adc85858978b1 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 6 Dec 2023 22:59:24 -0500 Subject: [PATCH 19/37] test build --- .../docs/reference/resource-configs/postgres-configs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index e230641c37a..d4e53efbc1d 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -111,10 +111,10 @@ models: The Postgres adapter supports [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | -|---------------------------|--------------|----------|---------|---------------------------| -| `on_configuration_change` | | no | `apply` | n/a | -| [indexes](#indexes) | | no | `none` | alter | +| Parameter | Type | Required | Default | Change Monitoring Support | +|---------------------------|------------|----------|---------|---------------------------| +| `on_configuration_change` | string | no | `apply` | n/a | +| [indexes](#indexes) | dictionary | no | `none` | alter | The `indexes` parameter corresponds to that of a table, as linked above. It's worth noting that, unlike with tables, dbt will monitor this parameter for changes and apply the changes without dropping the materialized view. From d19ea838bfd9d1538e7c1e264886e0620feebada Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 6 Dec 2023 23:08:08 -0500 Subject: [PATCH 20/37] add tabs back in --- .../resource-configs/postgres-configs.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index d4e53efbc1d..d47aaad7559 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -116,6 +116,84 @@ with the following configuration parameters: | `on_configuration_change` | string | no | `apply` | n/a | | [indexes](#indexes) | dictionary | no | `none` | alter | + + + + + + + +```yaml +models: + [](/reference/resource-configs/resource-path): + [+](/reference/resource-configs/plus-prefix)[materialized](/reference/resource-configs/materialized): materialized_view + [+](/reference/resource-configs/plus-prefix)on_configuration_change: apply | continue | fail + [+](/reference/resource-configs/plus-prefix)[indexes](#indexes): + - columns: [] + unique: true | false + type: hash | btree +``` + + + + + + + + + + +```yaml +version: 2 + +models: + - name: [] + config: + [materialized](/reference/resource-configs/materialized): materialized_view + on_configuration_change: apply | continue | fail + [indexes](#indexes): + - columns: [] + unique: true | false + type: hash | btree +``` + + + + + + + + + + +```jinja +{{ config( + [materialized](/reference/resource-configs/materialized)="materialized_view", + on_configuration_change="apply" | "continue" | "fail", + [indexes](#indexes)=[ + { + "columns": [""], + "unique": true | false, + "type": "hash" | "btree", + } + ] +) }} +``` + + + + + + + The `indexes` parameter corresponds to that of a table, as linked above. It's worth noting that, unlike with tables, dbt will monitor this parameter for changes and apply the changes without dropping the materialized view. This happens via a `DROP/CREATE` of the indexes, which could be thought of as a `ALTER` of the materialized view. From 139046b04d6d55fae6336ede64dbdf8afa7a7556 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 6 Dec 2023 23:33:23 -0500 Subject: [PATCH 21/37] add formatting back --- .../docs/reference/resource-configs/postgres-configs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index d47aaad7559..c904802d598 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -111,10 +111,10 @@ models: The Postgres adapter supports [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | -|---------------------------|------------|----------|---------|---------------------------| -| `on_configuration_change` | string | no | `apply` | n/a | -| [indexes](#indexes) | dictionary | no | `none` | alter | +| Parameter | Type | Required | Default | Change Monitoring Support | +|---------------------------|--------------------|----------|---------|---------------------------| +| `on_configuration_change` | `` | no | `apply` | n/a | +| [`indexes`](#indexes) | `[{}]` | no | `none` | alter | Date: Thu, 7 Dec 2023 12:20:56 -0500 Subject: [PATCH 22/37] update to use appropriate style guidelines --- .../resource-configs/bigquery-configs.md | 165 +++++++++++++----- 1 file changed, 126 insertions(+), 39 deletions(-) diff --git a/website/docs/reference/resource-configs/bigquery-configs.md b/website/docs/reference/resource-configs/bigquery-configs.md index 97acb73ce33..f9b447fdc0b 100644 --- a/website/docs/reference/resource-configs/bigquery-configs.md +++ b/website/docs/reference/resource-configs/bigquery-configs.md @@ -725,60 +725,147 @@ The `grant_access_to` config is not thread-safe when multiple views need to be a The BigQuery adapter supports [materialized views](https://cloud.google.com/bigquery/docs/materialized-views-intro) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | Reference | -|------------------------------|----------------------|----------|-----------|---------------------------|--------------------------------------------------| -| `on_configuration_change` | STRING | NO | `'apply'` | N/A | | -| `cluster_by` | LIST[STRING] | NO | | DROP/CREATE | [Clustering](#clustering-clause) | -| `partition_by` | DICT | NO | | DROP/CREATE | [Partitioning](#partition-clause) | -| `enable_refresh` | BOOLEAN | NO | `True` | ALTER | [Auto-refresh](#auto-refresh) | -| `refresh_interval_minutes` | FLOAT | NO | `30` | ALTER | [Auto-refresh](#auto-refresh) | -| `max_staleness` (in Preview) | INTERVAL | NO | | ALTER | [Auto-refresh](#auto-refresh) | -| `description` | STRING | NO | | ALTER | | -| `labels` | DICT[STRING, STRING] | NO | | ALTER | [Labels](#specifying-labels) | -| `hours_to_expiration` | INTEGER | NO | | ALTER | [Table expiration](controlling-table-expiration) | -| `kms_key_name` | STRING | NO | | ALTER | [KMS encryption](#using-kms-encryption) | - -#### Sample model file: - - +| Parameter | Type | Required | Default | Change Monitoring Support | +|--------------------------------------------------------|------------------------|----------|---------|---------------------------| +| `on_configuration_change` | `` | no | `apply` | n/a | +| [`cluster_by`](#clustering-clause) | `[]` | no | `none` | drop/create | +| [`partition_by`](#partition-clause) | `{}` | no | `none` | drop/create | +| [`enable_refresh`](#auto-refresh) | `` | no | `true` | alter | +| [`refresh_interval_minutes`](#auto-refresh) | `` | no | `30` | alter | +| [`max_staleness`](#auto-refresh) (in Preview) | `` | no | `none` | alter | +| `description` | `` | no | `none` | alter | +| [`labels`](#specifying-labels) | `{: }` | no | `none` | alter | +| [`hours_to_expiration`](#controlling-table-expiration) | `` | no | `none` | alter | +| [`kms_key_name`](#using-kms-encryption) | `` | no | `none` | alter | -```sql + + + + + + +directly to the materialized view in place. + +```yaml +models: + [](/reference/resource-configs/resource-path): + [+](/reference/resource-configs/plus-prefix)[materialized](/reference/resource-configs/materialized): materialized_view + [+](/reference/resource-configs/plus-prefix)on_configuration_change: apply | continue | fail + [+](/reference/resource-configs/plus-prefix)[cluster_by](#clustering-clause): | [] + [+](/reference/resource-configs/plus-prefix)[partition_by](#partition-clause): + - field: + - data_type: timestamp | date | datetime | int64 + # only if `data_type` is not 'int64' + - granularity: hour | day | month | year + # only if `data_type` is 'int64' + - range: + - start: + - end: + - interval: + [+](/reference/resource-configs/plus-prefix)[enable_refresh](#auto-refresh): true | false + [+](/reference/resource-configs/plus-prefix)[refresh_interval_minutes](#auto-refresh): + [+](/reference/resource-configs/plus-prefix)[max_staleness](#auto-refresh): + [+](/reference/resource-configs/plus-prefix)description: + [+](/reference/resource-configs/plus-prefix)[labels](#specifying-labels): {: } + [+](/reference/resource-configs/plus-prefix)[hours_to_expiration](#acontrolling-table-expiration): + [+](/reference/resource-configs/plus-prefix)[kms_key_name](##using-kms-encryption): +``` + + + + + + + + + + +```yaml +version: 2 + +models: + - name: [] + config: + [materialized](/reference/resource-configs/materialized): materialized_view + on_configuration_change: apply | continue | fail + [cluster_by](#clustering-clause): | [] + [partition_by](#partition-clause): + - field: + - data_type: timestamp | date | datetime | int64 + # only if `data_type` is not 'int64' + - granularity: hour | day | month | year + # only if `data_type` is 'int64' + - range: + - start: + - end: + - interval: + [enable_refresh](#auto-refresh): true | false + [refresh_interval_minutes](#auto-refresh): + [max_staleness](#auto-refresh): + description: + [labels](#specifying-labels): {: } + [hours_to_expiration](#acontrolling-table-expiration): + [kms_key_name](##using-kms-encryption): +``` + + + + + + + + + + +```jinja {{ config( materialized='materialized_view', - on_configuration_change='{ apply | continue | fail }' - cluster_by=['', ...], + on_configuration_change="apply" | "continue" | "fail", + cluster_by="" | [""], partition_by={ - 'field': '', - 'data_type': '', + "field": "", + "data_type": "timestamp" | "date" | "datetime" | "int64", # only if `data_type` is not 'int64' - 'granularity': '' + "granularity": "hour" | "day" | "month" | "year, # only if `data_type` is 'int64' - 'range': { - 'start': , - 'end': , - 'interval': , + "range": { + "start": , + "end": , + "interval": , } }, # auto-refresh options - enable_refresh=, + enable_refresh= true | false, refresh_interval_minutes=, - max_staleness='', + max_staleness="", # additional options - description='', - labels={'': '', ...}, - hours_to_expiration=, - kms_key_name='', + description="", + labels={ + "": "", + }, + hours_to_expiration=, + kms_key_name="", ) }} - -select * from {{ ref('my_base_table') }} ``` + + + + Many of these parameters correspond to their table counterparts and have been linked above. The set of parameters which are unique to materialized views covers auto-refresh functionality, which is covered [below](#auto-refresh). @@ -788,11 +875,11 @@ Find more information about these parameters in the BigQuery docs: ### Auto-refresh -| Parameter | Type | Required | Default | Change Monitoring Support | -|-------------------------------|----------|----------|---------|---------------------------| -| `enable_refresh` | BOOLEAN | NO | `True` | ALTER | -| `refresh_interval_minutes` | FLOAT | NO | `30` | ALTER | -| `max_staleness` (in Preview) | INTERVAL | NO | | ALTER | +| Parameter | Type | Required | Default | Change Monitoring Support | +|------------------------------|--------------|----------|---------|---------------------------| +| `enable_refresh` | `` | no | `true` | alter | +| `refresh_interval_minutes` | `` | no | `30` | alter | +| `max_staleness` (in Preview) | `` | no | `none` | alter | BigQuery supports [automatic refresh](https://cloud.google.com/bigquery/docs/materialized-views-manage#automatic_refresh) configuration for materialized views. By default, a materialized view will automatically refresh within 5 minutes of changes in the base table, but no more frequently than every 30 minutes. From 503253ef6a6b3ba5f6eb0586e6053bc26dcade6c Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Thu, 7 Dec 2023 12:33:30 -0500 Subject: [PATCH 23/37] update to use appropriate style guidelines --- .../resource-configs/snowflake-configs.md | 81 ++++++++++++++----- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index 900860ea287..c6ef5c4b339 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -355,44 +355,81 @@ of [materialized views](/docs/build/materializations#Materialized-View). In particular, dynamic tables have access to the `on_configuration_change` setting. Dynamic tables are supported with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | Reference | -|---------------------------|----------|----------|-----------|---------------------------|----------------------------------------------| -| `on_configuration_change` | STRING | NO | `apply` | N/A | | -| `target_lag` | STRING | YES | | ALTER | [Target lag](#target-lag) | -| `snowflake_warehouse` | STRING | YES | | ALTER | [Warehouse](#configuring-virtual-warehouses) | +| Parameter | Type | Required | Default | Change Monitoring Support | +|----------------------------------------------------------|------------|----------|---------|---------------------------| +| `on_configuration_change` | `` | no | `apply` | n/a | +| [`target_lag`](#target-lag) | `` | yes | | alter | +| [`snowflake_warehouse`](#configuring-virtual-warehouses) | `` | yes | | alter | -#### Sample model file: + - -```sql -{{ config( - materialized='dynamic_table', - on_configuration_change='{ apply | continue | fail }', - target_lag='< { seconds | minutes | hours | days } | DOWNSTREAM>', - snowflake_warehouse='', -) }} + + + -select * from {{ ref('my_base_table') }} +```yaml +models: + [](/reference/resource-configs/resource-path): + [+](/reference/resource-configs/plus-prefix)[materialized](/reference/resource-configs/materialized): dynamic_table + [+](/reference/resource-configs/plus-prefix)on_configuration_change: apply | continue | fail + [+](/reference/resource-configs/plus-prefix)[target_lag](#target-lag): downstream | + [+](/reference/resource-configs/plus-prefix)[snowflake_warehouse](#configuring-virtual-warehouses): ``` -#### Sample project file: + - + + + + ```yaml +version: 2 + models: - path: - materialized: dynamic_table - on_configuration_change: '' - snowflake_warehouse: '' - target_lag: '< { seconds | minutes | hours | days } | DOWNSTREAM>' + - name: [] + config: + [materialized](/reference/resource-configs/materialized): dynamic_table + on_configuration_change: apply | continue | fail + [target_lag](#target-lag): downstream | + [snowflake_warehouse](#configuring-virtual-warehouses): ``` + + + + + + + +```jinja +{{ config( + materialized="dynamic_table", + on_configuration_change="apply" | "continue" | "fail", + target_lag="downstream" | " seconds | minutes | hours | days", + snowflake_warehouse="", +) }} +``` + + + + + + + Find more information about these parameters in the Snowflake docs: - [CREATE DYNAMIC TABLE](https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table) From ab2584c86a86052c84a1da4cda57ce8f391a0331 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Thu, 7 Dec 2023 13:11:04 -0500 Subject: [PATCH 24/37] update to use appropriate style guidelines --- .../resource-configs/redshift-configs.md | 112 +++++++++++++----- 1 file changed, 85 insertions(+), 27 deletions(-) diff --git a/website/docs/reference/resource-configs/redshift-configs.md b/website/docs/reference/resource-configs/redshift-configs.md index 0e079453ec6..44b66b30005 100644 --- a/website/docs/reference/resource-configs/redshift-configs.md +++ b/website/docs/reference/resource-configs/redshift-configs.md @@ -114,36 +114,94 @@ models: The Redshift adapter supports [materialized views](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-overview.html) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | Reference | -|---------------------------|--------------|----------|------------------------|---------------------------|-------------------------------------------------| -| `on_configuration_change` | STRING | NO | `'apply'` | N/A | | -| `dist` | STRING | NO | `'EVEN'` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| `sort` | LIST[STRING] | NO | | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| `sort_type` | STRING | NO | `'AUTO'` if no `sort` | DROP/CREATE | [Sortkey / Distkey](#using-sortkey-and-distkey) | -| | | | `'COMPOUND'` if `sort` | | | -| `auto_refresh` | BOOLEAN | NO | `False` | ALTER | [Auto refresh](#auto-refresh) | -| `backup` | BOOLEAN | HO | `True` | N/A | [Backup](#backup) | +| Parameter | Type | Required | Default | Change Monitoring Support | +|-------------------------------------------|--------------|----------|----------------------|---------------------------| +| `on_configuration_change` | `` | no | `apply` | n/a | +| [`dist`](#using-sortkey-and-distkey) | `` | no | `even` | drop/create | +| [`sort`](#using-sortkey-and-distkey) | `[]` | no | `none` | drop/create | +| [`sort_type`](#using-sortkey-and-distkey) | `` | no | `auto` if no `sort` | drop/create | +| | | | `compound` if `sort` | | +| [`auto_refresh`](#auto-refresh) | `` | no | `false` | alter | +| [`backup`](#backup) | `` | no | `true` | n/a | + + + + + -#### Sample model file: + - +```yaml +models: + [](/reference/resource-configs/resource-path): + [+](/reference/resource-configs/plus-prefix)[materialized](/reference/resource-configs/materialized): materialized_view + [+](/reference/resource-configs/plus-prefix)on_configuration_change: apply | continue | fail + [+](/reference/resource-configs/plus-prefix)[dist](#using-sortkey-and-distkey): all | auto | even | + [+](/reference/resource-configs/plus-prefix)[sort](#using-sortkey-and-distkey): | [] + [+](/reference/resource-configs/plus-prefix)[sort_type](#using-sortkey-and-distkey): auto | compound | interleaved + [+](/reference/resource-configs/plus-prefix)[auto_refresh](#auto-refresh): true | false + [+](/reference/resource-configs/plus-prefix)[backup](#backup): true | false +``` -```sql + + + + + + + + + +```yaml +version: 2 + +models: + - name: [] + config: + [materialized](/reference/resource-configs/materialized): materialized_view + on_configuration_change: apply | continue | fail + [dist](#using-sortkey-and-distkey): all | auto | even | + [sort](#using-sortkey-and-distkey): | [] + [sort_type](#using-sortkey-and-distkey): auto | compound | interleaved + [auto_refresh](#auto-refresh): true | false + [backup](#backup): true | false +``` + + + + + + + + + + +```jinja {{ config( - materialized='materialized_view', - on_configuration_change='{ apply | continue | fail }' - dist='{ ALL | AUTO | EVEN | }', - sort=['', ...], - sort_type='{ AUTO | COMPOUND | INTERLEAVED }' - auto_refresh=, - backup=, + materialized="materialized_view", + on_configuration_change="apply" | "continue" | "fail", + dist="all" | "auto" | "even" | "", + sort=[""], + sort_type="auto" | "compound" | "interleaved", + auto_refresh=true | false, + backup=true | false, ) }} - -select * from {{ ref('my_base_table') }} ``` + + + + Many of these parameters correspond to their table counterparts and have been linked above. The parameters unique to materialized views are the auto-refresh and backup functionality, which are covered below. @@ -151,9 +209,9 @@ Find more information about the [CREATE MATERIALIZED VIEW](https://docs.aws.amaz #### Auto-refresh -| Parameter | Type | Required | Default | Change Monitoring Support | -|----------------|---------|----------|---------|---------------------------| -| `auto_refresh` | BOOLEAN | NO | `False` | ALTER | +| Parameter | Type | Required | Default | Change Monitoring Support | +|----------------|-------------|----------|---------|---------------------------| +| `auto_refresh` | `` | no | `false` | alter | Redshift supports [automatic refresh](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-refresh.html#materialized-view-auto-refresh) configuration for materialized views. By default, a materialized view does not automatically refresh. @@ -163,9 +221,9 @@ Find more information about the [parameters](https://docs.aws.amazon.com/redshif #### Backup -| Parameter | Type | Required | Default | Change Monitoring Support | -|-----------|---------|----------|---------|---------------------------| -| `backup` | BOOLEAN | NO | `True` | N/A | +| Parameter | Type | Required | Default | Change Monitoring Support | +|-----------|-------------|----------|---------|---------------------------| +| `backup` | `` | no | `true` | n/a | Redshift supports [backup](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html) configuration of clusters at the object level. This parameter identifies if the materialized view should be backed up as part of the cluster snapshot. From b0b94c64f9ee1978ac2f0a6bfe21bb1a695b9d05 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Thu, 7 Dec 2023 23:18:29 -0500 Subject: [PATCH 25/37] combine sort type option into the same row --- .../resource-configs/redshift-configs.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/website/docs/reference/resource-configs/redshift-configs.md b/website/docs/reference/resource-configs/redshift-configs.md index 44b66b30005..c7fc0671c0b 100644 --- a/website/docs/reference/resource-configs/redshift-configs.md +++ b/website/docs/reference/resource-configs/redshift-configs.md @@ -114,15 +114,14 @@ models: The Redshift adapter supports [materialized views](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-overview.html) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | -|-------------------------------------------|--------------|----------|----------------------|---------------------------| -| `on_configuration_change` | `` | no | `apply` | n/a | -| [`dist`](#using-sortkey-and-distkey) | `` | no | `even` | drop/create | -| [`sort`](#using-sortkey-and-distkey) | `[]` | no | `none` | drop/create | -| [`sort_type`](#using-sortkey-and-distkey) | `` | no | `auto` if no `sort` | drop/create | -| | | | `compound` if `sort` | | -| [`auto_refresh`](#auto-refresh) | `` | no | `false` | alter | -| [`backup`](#backup) | `` | no | `true` | n/a | +| Parameter | Type | Required | Default | Change Monitoring Support | +|-------------------------------------------|--------------|----------|------------------------------------------------|---------------------------| +| `on_configuration_change` | `` | no | `apply` | n/a | +| [`dist`](#using-sortkey-and-distkey) | `` | no | `even` | drop/create | +| [`sort`](#using-sortkey-and-distkey) | `[]` | no | `none` | drop/create | +| [`sort_type`](#using-sortkey-and-distkey) | `` | no | `auto` if no `sort`
`compound` if `sort` | drop/create | +| [`auto_refresh`](#auto-refresh) | `` | no | `false` | alter | +| [`backup`](#backup) | `` | no | `true` | n/a | Date: Fri, 8 Dec 2023 15:32:25 -0500 Subject: [PATCH 26/37] add reference links to config block version --- .../reference/resource-configs/redshift-configs.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/reference/resource-configs/redshift-configs.md b/website/docs/reference/resource-configs/redshift-configs.md index c7fc0671c0b..f610d19a346 100644 --- a/website/docs/reference/resource-configs/redshift-configs.md +++ b/website/docs/reference/resource-configs/redshift-configs.md @@ -185,13 +185,13 @@ models: ```jinja {{ config( - materialized="materialized_view", + [materialized](/reference/resource-configs/materialized)="materialized_view", on_configuration_change="apply" | "continue" | "fail", - dist="all" | "auto" | "even" | "", - sort=[""], - sort_type="auto" | "compound" | "interleaved", - auto_refresh=true | false, - backup=true | false, + [dist](#using-sortkey-and-distkey)="all" | "auto" | "even" | "", + [sort](#using-sortkey-and-distkey)=[""], + [sort_type](#using-sortkey-and-distkey)="auto" | "compound" | "interleaved", + [auto_refresh](#auto-refresh)=true | false, + [backup](#backup)=true | false, ) }} ``` From 20ae17beeecb7d2eced51a81f1f157421139b372 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Fri, 8 Dec 2023 15:34:31 -0500 Subject: [PATCH 27/37] add reference links to config block version --- .../resource-configs/bigquery-configs.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/website/docs/reference/resource-configs/bigquery-configs.md b/website/docs/reference/resource-configs/bigquery-configs.md index f9b447fdc0b..ea20be4fb41 100644 --- a/website/docs/reference/resource-configs/bigquery-configs.md +++ b/website/docs/reference/resource-configs/bigquery-configs.md @@ -827,10 +827,10 @@ models: ```jinja {{ config( - materialized='materialized_view', + [materialized](/reference/resource-configs/materialized)='materialized_view', on_configuration_change="apply" | "continue" | "fail", - cluster_by="" | [""], - partition_by={ + [cluster_by](#clustering-clause)="" | [""], + [partition_by](#partition-clause)={ "field": "", "data_type": "timestamp" | "date" | "datetime" | "int64", @@ -846,17 +846,17 @@ models: }, # auto-refresh options - enable_refresh= true | false, - refresh_interval_minutes=, - max_staleness="", + [enable_refresh](#auto-refresh)= true | false, + [refresh_interval_minutes](#auto-refresh)=, + [max_staleness](#auto-refresh)="", # additional options description="", - labels={ + [labels](#specifying-labels)={ "": "", }, - hours_to_expiration=, - kms_key_name="", + [hours_to_expiration](#acontrolling-table-expiration)=, + [kms_key_name](##using-kms-encryption)="", ) }} ``` From ecc39ab9c905e9750016e7f9d689aeafd508fbbc Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Fri, 8 Dec 2023 15:35:39 -0500 Subject: [PATCH 28/37] add reference links to config block version --- .../docs/reference/resource-configs/snowflake-configs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index c6ef5c4b339..a5c2e6f57d9 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -417,10 +417,10 @@ models: ```jinja {{ config( - materialized="dynamic_table", + [materialized](/reference/resource-configs/materialized)="dynamic_table", on_configuration_change="apply" | "continue" | "fail", - target_lag="downstream" | " seconds | minutes | hours | days", - snowflake_warehouse="", + [target_lag](#target-lag)="downstream" | " seconds | minutes | hours | days", + [snowflake_warehouse](#configuring-virtual-warehouses)="", ) }} ``` From 279238f500dbdef1a30ea098a4d48318757aa0a7 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:06:04 -0500 Subject: [PATCH 29/37] Update website/docs/reference/resource-configs/bigquery-configs.md Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --- website/docs/reference/resource-configs/bigquery-configs.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-configs/bigquery-configs.md b/website/docs/reference/resource-configs/bigquery-configs.md index ea20be4fb41..9e61a8d5265 100644 --- a/website/docs/reference/resource-configs/bigquery-configs.md +++ b/website/docs/reference/resource-configs/bigquery-configs.md @@ -752,7 +752,6 @@ with the following configuration parameters: -directly to the materialized view in place. ```yaml models: From 1fc78210e06413cc8722b6d323298cdd92735ffe Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 13 Dec 2023 12:04:45 -0500 Subject: [PATCH 30/37] add link to description docs --- .../resource-configs/bigquery-configs.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/website/docs/reference/resource-configs/bigquery-configs.md b/website/docs/reference/resource-configs/bigquery-configs.md index 9e61a8d5265..d47562ec2bb 100644 --- a/website/docs/reference/resource-configs/bigquery-configs.md +++ b/website/docs/reference/resource-configs/bigquery-configs.md @@ -725,18 +725,18 @@ The `grant_access_to` config is not thread-safe when multiple views need to be a The BigQuery adapter supports [materialized views](https://cloud.google.com/bigquery/docs/materialized-views-intro) with the following configuration parameters: -| Parameter | Type | Required | Default | Change Monitoring Support | -|--------------------------------------------------------|------------------------|----------|---------|---------------------------| -| `on_configuration_change` | `` | no | `apply` | n/a | -| [`cluster_by`](#clustering-clause) | `[]` | no | `none` | drop/create | -| [`partition_by`](#partition-clause) | `{}` | no | `none` | drop/create | -| [`enable_refresh`](#auto-refresh) | `` | no | `true` | alter | -| [`refresh_interval_minutes`](#auto-refresh) | `` | no | `30` | alter | -| [`max_staleness`](#auto-refresh) (in Preview) | `` | no | `none` | alter | -| `description` | `` | no | `none` | alter | -| [`labels`](#specifying-labels) | `{: }` | no | `none` | alter | -| [`hours_to_expiration`](#controlling-table-expiration) | `` | no | `none` | alter | -| [`kms_key_name`](#using-kms-encryption) | `` | no | `none` | alter | +| Parameter | Type | Required | Default | Change Monitoring Support | +|-------------------------------------------------------------|------------------------|----------|---------|---------------------------| +| `on_configuration_change` | `` | no | `apply` | n/a | +| [`cluster_by`](#clustering-clause) | `[]` | no | `none` | drop/create | +| [`partition_by`](#partition-clause) | `{}` | no | `none` | drop/create | +| [`enable_refresh`](#auto-refresh) | `` | no | `true` | alter | +| [`refresh_interval_minutes`](#auto-refresh) | `` | no | `30` | alter | +| [`max_staleness`](#auto-refresh) (in Preview) | `` | no | `none` | alter | +| [`description`](/reference/resource-properties/description) | `` | no | `none` | alter | +| [`labels`](#specifying-labels) | `{: }` | no | `none` | alter | +| [`hours_to_expiration`](#controlling-table-expiration) | `` | no | `none` | alter | +| [`kms_key_name`](#using-kms-encryption) | `` | no | `none` | alter | [+](/reference/resource-configs/plus-prefix)[max_staleness](#auto-refresh): - [+](/reference/resource-configs/plus-prefix)description: + [+](/reference/resource-configs/plus-prefix)[description](/reference/resource-properties/description): [+](/reference/resource-configs/plus-prefix)[labels](#specifying-labels): {: } [+](/reference/resource-configs/plus-prefix)[hours_to_expiration](#acontrolling-table-expiration): [+](/reference/resource-configs/plus-prefix)[kms_key_name](##using-kms-encryption): @@ -809,7 +809,7 @@ models: [enable_refresh](#auto-refresh): true | false [refresh_interval_minutes](#auto-refresh): [max_staleness](#auto-refresh): - description: + [description](/reference/resource-properties/description): [labels](#specifying-labels): {: } [hours_to_expiration](#acontrolling-table-expiration): [kms_key_name](##using-kms-encryption): @@ -850,7 +850,7 @@ models: [max_staleness](#auto-refresh)="", # additional options - description="", + [description](/reference/resource-properties/description)="", [labels](#specifying-labels)={ "": "", }, From 8f1268241aad643772c0e9308eff5a2c7ada5ac8 Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:13:54 -0700 Subject: [PATCH 31/37] Update description of robust testing --- website/docs/community/resources/oss-expectations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/community/resources/oss-expectations.md b/website/docs/community/resources/oss-expectations.md index 762e87d97fb..a57df7fe67f 100644 --- a/website/docs/community/resources/oss-expectations.md +++ b/website/docs/community/resources/oss-expectations.md @@ -94,7 +94,7 @@ PRs are your surest way to make the change you want to see in dbt / packages / d **Every PR should be associated with an issue.** Why? Before you spend a lot of time working on a contribution, we want to make sure that your proposal will be accepted. You should open an issue first, describing your desired outcome and outlining your planned change. If you've found an older issue that's already open, comment on it with an outline for your planned implementation. Exception to this rule: If you're just opening a PR for a cosmetic fix, such as a typo in documentation, an issue isn't needed. -**PRs should include robust testing.** With the goal to substantially cut down the number and impact of regressions, we are taking a more meticulous approach to the tests that we require to merge a pull request. We recognize that robust testing can often take significantly more effort than the main portion of the code. Thank you for your help in contributing to this goal! +**PRs should include robust testing.** Comprehensive testing within pull requests is crucial for the stability of our project. By prioritizing robust testing, we ensure the reliability of our codebase, minimize unforeseen issues and safeguard against potential regressions. We understand that creating thorough tests often requires significant effort, and your dedication to this process greatly contributes to the project's overall reliability. Thank you for your commitment to maintaining the integrity of our codebase!" **Our goal is to review most new PRs within 7 days.** The first review will include some high-level comments about the implementation, including (at a high level) whether it’s something we think suitable to merge. Depending on the scope of the PR, the first review may include line-level code suggestions, or we may delay specific code review until the PR is more finalized / until we have more time. From 776e159ed5fc67e138965b071253ac44eaee54b2 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:36:52 -0500 Subject: [PATCH 32/37] Apply suggestions from code review --- .../resource-configs/bigquery-configs.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/website/docs/reference/resource-configs/bigquery-configs.md b/website/docs/reference/resource-configs/bigquery-configs.md index d47562ec2bb..d3497a02caf 100644 --- a/website/docs/reference/resource-configs/bigquery-configs.md +++ b/website/docs/reference/resource-configs/bigquery-configs.md @@ -866,7 +866,7 @@ models: Many of these parameters correspond to their table counterparts and have been linked above. -The set of parameters which are unique to materialized views covers auto-refresh functionality, which is covered [below](#auto-refresh). +The set of parameters unique to materialized views covers [auto-refresh functionality](#auto-refresh). Find more information about these parameters in the BigQuery docs: - [CREATE MATERIALIZED VIEW statement](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_materialized_view_statement) @@ -881,9 +881,9 @@ Find more information about these parameters in the BigQuery docs: | `max_staleness` (in Preview) | `` | no | `none` | alter | BigQuery supports [automatic refresh](https://cloud.google.com/bigquery/docs/materialized-views-manage#automatic_refresh) configuration for materialized views. -By default, a materialized view will automatically refresh within 5 minutes of changes in the base table, but no more frequently than every 30 minutes. -BigQuery only officially supports configuration of the frequency (the "30 minutes" part); -however, there is a feature in preview that allows for configuration of the staleness (the "5 minutes" part). +By default, a materialized view will automatically refresh within 5 minutes of changes in the base table, but not more frequently than once every 30 minutes. +BigQuery only officially supports the configuration of the frequency (the "once every 30 minutes" frequency); +however, there is a feature in preview that allows for the configuration of the staleness (the "5 minutes" refresh). dbt will monitor these parameters for changes and apply them using an `ALTER` statement. Find more information about these parameters in the BigQuery docs: @@ -894,11 +894,11 @@ Find more information about these parameters in the BigQuery docs: As with most data platforms, there are limitations associated with materialized views. Some worth noting include: -- Materialized view SQL has a [limited feature set](https://cloud.google.com/bigquery/docs/materialized-views-create#supported-mvs) -- Materialized view SQL cannot be updated; the materialized view must go through a `--full-refresh` (DROP/CREATE) -- The `partition_by` clause on a materialized view must match that of the underlying base table -- While materialized views can have descriptions, materialized view *columns* cannot -- Recreating/dropping the base table requires recreating/dropping the materialized view +- Materialized view SQL has a [limited feature set](https://cloud.google.com/bigquery/docs/materialized-views-create#supported-mvs). +- Materialized view SQL cannot be updated; the materialized view must go through a `--full-refresh` (DROP/CREATE). +- The `partition_by` clause on a materialized view must match that of the underlying base table. +- While materialized views can have descriptions, materialized view *columns* cannot. +- Recreating/dropping the base table requires recreating/dropping the materialized view. Find more information about materialized view limitations in Google's BigQuery [docs](https://cloud.google.com/bigquery/docs/materialized-views-intro#limitations). From 5d2fd560124e5cf89797a484f52abe3307da736d Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:16:18 -0500 Subject: [PATCH 33/37] Update snowflake-configs.md --- .../resource-configs/snowflake-configs.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index a5c2e6f57d9..a24b072d39c 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -435,21 +435,18 @@ Find more information about these parameters in the Snowflake docs: ### Target lag -Snowflake allows two configuration scenarios for scheduling automatic refreshes: time-based and dependency-based. -For time-based automatic refreshes, provide a value of the form ` { seconds | minutes | hours | days }`. -For example, if the dynamic table needs to be updated every 30 minutes, use `target_lag='30 minutes'`. -However, for scenarios where the referenced objects are themselves dynamic tables, it might be desirable to refresh -the dynamic table whenever the underlying dynamic table is refreshed. In this scenario, use `target_lag='downstream'`. -This allows for refresh schedules to be controlled once, at the source, instead of at each layer. +Snowflake allows two configuration scenarios for scheduling automatic refreshes: +- **Time-based** — Provide a value of the form ` { seconds | minutes | hours | days }`. For example, if the dynamic table needs to be updated every 30 minutes, use `target_lag='30 minutes'`. +- **Downstream** — For scenarios where the referenced objects are themselves dynamic tables, it might be desirable to refresh the dynamic table whenever the underlying dynamic table is refreshed. In this scenario, use `target_lag='downstream'`. This allows for refresh schedules to be controlled once, at the source, instead of at each layer. ### Limitations As with materialized views on most data platforms, there are limitations associated with dynamic tables. Some worth noting include: -- Dynamic table SQL has a [limited feature set](https://docs.snowflake.com/en/user-guide/dynamic-tables-tasks-create#query-constructs-not-currently-supported-in-dynamic-tables) -- Dynamic table SQL cannot be updated; the dynamic table must go through a `--full-refresh` (DROP/CREATE) -- Dynamic tables cannot be downstream from: materialized views, external tables, streams -- Dynamic tables cannot reference a view that is downstream from another dynamic table +- Dynamic table SQL has a [limited feature set](https://docs.snowflake.com/en/user-guide/dynamic-tables-tasks-create#query-constructs-not-currently-supported-in-dynamic-tables). +- Dynamic table SQL cannot be updated; the dynamic table must go through a `--full-refresh` (DROP/CREATE). +- Dynamic tables cannot be downstream from: materialized views, external tables, streams. +- Dynamic tables cannot reference a view that is downstream from another dynamic table. Find more information about dynamic table limitations in Snowflake's [docs](https://docs.snowflake.com/en/user-guide/dynamic-tables-tasks-create#dynamic-table-limitations-and-supported-functions). From 9923e29b4820d489aaaad4957e010d5639bcc93b Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:24:38 -0500 Subject: [PATCH 34/37] Apply suggestions from code review --- website/docs/reference/resource-configs/redshift-configs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/resource-configs/redshift-configs.md b/website/docs/reference/resource-configs/redshift-configs.md index f610d19a346..b559c0451b0 100644 --- a/website/docs/reference/resource-configs/redshift-configs.md +++ b/website/docs/reference/resource-configs/redshift-configs.md @@ -202,7 +202,7 @@ models: Many of these parameters correspond to their table counterparts and have been linked above. -The parameters unique to materialized views are the auto-refresh and backup functionality, which are covered below. +The parameters unique to materialized views are the [auto-refresh](#auto-refresh) and [backup](#backup) functionality, which are covered below. Find more information about the [CREATE MATERIALIZED VIEW](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html) parameters in the Redshift docs. @@ -216,7 +216,7 @@ Redshift supports [automatic refresh](https://docs.aws.amazon.com/redshift/lates By default, a materialized view does not automatically refresh. dbt monitors this parameter for changes and applies them using an `ALTER` statement. -Find more information about the [parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) in the Redshift docs. +Learn more information about the [parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) in the Redshift docs. #### Backup @@ -230,7 +230,7 @@ By default, a materialized view will be backed up during a cluster snapshot. dbt cannot monitor this parameter as it is not queryable within Redshift. If the value is changed, the materialized view will need to go through a `--full-refresh` in order to set it. -Find more information about the [parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) in the Redshift docs. +Learn more about the [parameters](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html#mv_CREATE_MATERIALIZED_VIEW-parameters) in the Redshift docs. ### Limitations From b84b59eba4b990ef6ca4c1c883b658f0a3f34bd7 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 13 Dec 2023 14:11:45 -0500 Subject: [PATCH 35/37] update downstream option for target_lag, fix external docs reference to be consistent --- .../docs/reference/resource-configs/snowflake-configs.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index a24b072d39c..aa2bf370df6 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -430,14 +430,15 @@ models:
-Find more information about these parameters in the Snowflake docs: -- [CREATE DYNAMIC TABLE](https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table) +Find more information about these parameters in Snowflake's [docs](https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table): ### Target lag Snowflake allows two configuration scenarios for scheduling automatic refreshes: - **Time-based** — Provide a value of the form ` { seconds | minutes | hours | days }`. For example, if the dynamic table needs to be updated every 30 minutes, use `target_lag='30 minutes'`. -- **Downstream** — For scenarios where the referenced objects are themselves dynamic tables, it might be desirable to refresh the dynamic table whenever the underlying dynamic table is refreshed. In this scenario, use `target_lag='downstream'`. This allows for refresh schedules to be controlled once, at the source, instead of at each layer. +- **Downstream** — Applicable when the dynamic table is referenced by other dynamic tables. In this scenario, `target_lag='downstream'` allows for refreshes to be controlled at the target, instead of at each layer. + +Find more information about `target_lag` in Snowflake's [docs](https://docs.snowflake.com/en/user-guide/dynamic-tables-refresh#understanding-target-lag). ### Limitations From 6ac9d633d37c75762bfff7a349a13ffbb72bf4fd Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:14:16 -0500 Subject: [PATCH 36/37] Apply suggestions from code review --- website/docs/reference/resource-configs/postgres-configs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index c904802d598..c01ea9ea718 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -194,9 +194,9 @@ models: -The `indexes` parameter corresponds to that of a table, as linked above. -It's worth noting that, unlike with tables, dbt will monitor this parameter for changes and apply the changes without dropping the materialized view. -This happens via a `DROP/CREATE` of the indexes, which could be thought of as a `ALTER` of the materialized view. +The [`indexes`](#indexes) parameter corresponds to that of a table, as explained above. +It's worth noting that, unlike with tables, dbt monitors this parameter for changes and applies the changes without dropping the materialized view. +This happens via a `DROP/CREATE` of the indexes, which can be thought of as an `ALTER` of the materialized view. Find more information about materialized view parameters in the Postgres docs: - [CREATE MATERIALIZED VIEW](https://www.postgresql.org/docs/current/sql-creatematerializedview.html) From e4b780cefa4fd7852ca593488faed5c150beb7d3 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:14:42 -0500 Subject: [PATCH 37/37] Update website/docs/reference/resource-configs/postgres-configs.md --- website/docs/reference/resource-configs/postgres-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/postgres-configs.md b/website/docs/reference/resource-configs/postgres-configs.md index c01ea9ea718..8465a5cbb31 100644 --- a/website/docs/reference/resource-configs/postgres-configs.md +++ b/website/docs/reference/resource-configs/postgres-configs.md @@ -195,7 +195,7 @@ models: The [`indexes`](#indexes) parameter corresponds to that of a table, as explained above. -It's worth noting that, unlike with tables, dbt monitors this parameter for changes and applies the changes without dropping the materialized view. +It's worth noting that, unlike tables, dbt monitors this parameter for changes and applies the changes without dropping the materialized view. This happens via a `DROP/CREATE` of the indexes, which can be thought of as an `ALTER` of the materialized view. Find more information about materialized view parameters in the Postgres docs: