From c31926f6ad3bf9515d928c3da09bc64552ba7ff0 Mon Sep 17 00:00:00 2001 From: Matt Bessey Date: Mon, 6 Jul 2020 21:20:57 +0100 Subject: [PATCH 1/4] Snowflake: Automatic Clustering update I have not actually used this feature yet, but just reading the docs they appear to be out of line with Snowflake's https://docs.snowflake.com/en/user-guide/tables-clustering-manual.html --- website/docs/reference/resource-configs/snowflake-configs.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index 23743866387..e3dd0ccb907 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -161,7 +161,9 @@ create or replace table my_database.my_schema.my_table as ( ### Automatic clustering -Automatic clustering is a preview feature in Snowflake (at the time of this writing) and as such, some accounts may have it turned on while others may not. You can use the `automatic_clustering` config to control whether or not automatic clustering is enabled for dbt models. When `automatic_clustering` is set to `true`, dbt will run an `alter table resume recluster` query after building the target table. This configuration is only required for Snowflake accounts which do not have automatic clustering enabled. For more information, consult the [Snowflake documentation on Manual Reclustering](https://docs.snowflake.net/manuals/user-guide/tables-clustering-manual.html#switching-from-manual-reclustering-to-automatic-clustering). +Automatic clustering is [enabled by default in Snowflake today](https://docs.snowflake.com/en/user-guide/tables-clustering-manual.html), no action is needed to make use of it. Though there is an `automatic_clustering` config, it has no effect except for accounts with (deprecated) manual clustering enabled. + +If [manual clustering is still enabled for your account](https://docs.snowflake.com/en/user-guide/tables-clustering-manual.html), you can use the `automatic_clustering` config to control whether or not automatic clustering is enabled for dbt models. When `automatic_clustering` is set to `true`, dbt will run an `alter table
resume recluster` query after building the target table. The `automatic_clustering` config can be specified in the `dbt_project.yml` file, or in a model `config()` block. From 7515ef44ec8d5e02a5e1aff5dfddfaf6c1e06a81 Mon Sep 17 00:00:00 2001 From: Matt Bessey Date: Mon, 6 Jul 2020 21:29:11 +0100 Subject: [PATCH 2/4] Snowflake: update SSO authentication cache docs As found in https://github.com/fishtown-analytics/dbt/issues/1172#issuecomment-652917984 --- website/docs/reference/warehouse-profiles/snowflake-profile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/warehouse-profiles/snowflake-profile.md b/website/docs/reference/warehouse-profiles/snowflake-profile.md index 2f9dade7e18..95bc8bbaf7d 100644 --- a/website/docs/reference/warehouse-profiles/snowflake-profile.md +++ b/website/docs/reference/warehouse-profiles/snowflake-profile.md @@ -68,7 +68,7 @@ my-snowflake-db: To use SSO authentication for Snowflake, omit a `password` and instead supply an `authenticator` config to your target. `authenticator` can be one of 'externalbrowser' or a valid Okta URL. -**Note**: By default, every connection that dbt opens will require you to re-authenticate in a browser. Contact your Snowflake support rep and inquire about turning on the "id token cache" for your account as described [here](https://github.com/snowflakedb/snowflake-connector-python/issues/140#issuecomment-447028785). +**Note**: By default, every connection that dbt opens will require you to re-authenticate in a browser. The Snowflake connector package supports cacheing your session token, but it [currently only supports Windows and Mac OS](https://docs.snowflake.com/en/user-guide/odbc-parameters.html#using-browser-based-sso-with-connection-caching-macos-and-windows-only). See [the Snowflake docs](https://docs.snowflake.com/en/user-guide/odbc-parameters.html#using-browser-based-sso-with-connection-caching-macos-and-windows-only) for how to enable this feature in your account. From 096fc3dedc80fb91713d1d09c35f4bc18d097ef3 Mon Sep 17 00:00:00 2001 From: Matt Bessey Date: Sat, 12 Sep 2020 11:40:57 +0100 Subject: [PATCH 3/4] Snowflake: add id cache notice to changelog --- .../docs/docs/guides/migration-guide/upgrading-to-0-18-0.md | 1 + .../docs/reference/warehouse-profiles/snowflake-profile.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/website/docs/docs/guides/migration-guide/upgrading-to-0-18-0.md b/website/docs/docs/guides/migration-guide/upgrading-to-0-18-0.md index 1a8076bdba2..11e80d4ea73 100644 --- a/website/docs/docs/guides/migration-guide/upgrading-to-0-18-0.md +++ b/website/docs/docs/guides/migration-guide/upgrading-to-0-18-0.md @@ -75,6 +75,7 @@ can override schema test definitions **Snowflake** - `query_tag` in [profile](snowflake-profile), [model config](snowflake-configs#query-tags) +- automatic SSO [session caching](snowflake-configs#sso-authentication) support **BigQuery** - [`impersonate_service_account`](https://docs.getdbt.com/reference/warehouse-profiles/bigquery-profile#service-account-impersonation) diff --git a/website/docs/reference/warehouse-profiles/snowflake-profile.md b/website/docs/reference/warehouse-profiles/snowflake-profile.md index 95bc8bbaf7d..c7d0020635f 100644 --- a/website/docs/reference/warehouse-profiles/snowflake-profile.md +++ b/website/docs/reference/warehouse-profiles/snowflake-profile.md @@ -68,7 +68,9 @@ my-snowflake-db: To use SSO authentication for Snowflake, omit a `password` and instead supply an `authenticator` config to your target. `authenticator` can be one of 'externalbrowser' or a valid Okta URL. -**Note**: By default, every connection that dbt opens will require you to re-authenticate in a browser. The Snowflake connector package supports cacheing your session token, but it [currently only supports Windows and Mac OS](https://docs.snowflake.com/en/user-guide/odbc-parameters.html#using-browser-based-sso-with-connection-caching-macos-and-windows-only). See [the Snowflake docs](https://docs.snowflake.com/en/user-guide/odbc-parameters.html#using-browser-based-sso-with-connection-caching-macos-and-windows-only) for how to enable this feature in your account. +New in v0.18.0 + +**Note**: By default, every connection that dbt opens will require you to re-authenticate in a browser. The Snowflake connector package supports caching your session token, but it [currently only supports Windows and Mac OS](https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-use.html#optional-using-connection-caching-to-minimize-the-number-of-prompts-for-authentication). See [the Snowflake docs](https://docs.snowflake.com/en/sql-reference/parameters.html#label-allow-id-token) for how to enable this feature in your account. From 5a31d176ed4b6c25a283e181f1c8fb9b37386428 Mon Sep 17 00:00:00 2001 From: Matt Bessey Date: Sat, 12 Sep 2020 11:42:23 +0100 Subject: [PATCH 4/4] Snowflake: fix links to automatic clustering --- .../docs/reference/resource-configs/snowflake-configs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/reference/resource-configs/snowflake-configs.md b/website/docs/reference/resource-configs/snowflake-configs.md index e3dd0ccb907..d3237798aa9 100644 --- a/website/docs/reference/resource-configs/snowflake-configs.md +++ b/website/docs/reference/resource-configs/snowflake-configs.md @@ -82,8 +82,8 @@ select ... ``` -**Note:** query tags are set at the _session_ level. At the start of each model -materialization, if the model has a custom `query_tag` +**Note:** query tags are set at the _session_ level. At the start of each model +materialization, if the model has a custom `query_tag` configured, dbt will run `alter session set query_tag` to set the new value. At the end of the materialization, dbt will run another `alter` statement to reset the tag to its default value. As such, build failures midway through a materialization may result in subsequent @@ -161,9 +161,9 @@ create or replace table my_database.my_schema.my_table as ( ### Automatic clustering -Automatic clustering is [enabled by default in Snowflake today](https://docs.snowflake.com/en/user-guide/tables-clustering-manual.html), no action is needed to make use of it. Though there is an `automatic_clustering` config, it has no effect except for accounts with (deprecated) manual clustering enabled. +Automatic clustering is [enabled by default in Snowflake today](https://docs.snowflake.com/en/user-guide/tables-auto-reclustering.html), no action is needed to make use of it. Though there is an `automatic_clustering` config, it has no effect except for accounts with (deprecated) manual clustering enabled. -If [manual clustering is still enabled for your account](https://docs.snowflake.com/en/user-guide/tables-clustering-manual.html), you can use the `automatic_clustering` config to control whether or not automatic clustering is enabled for dbt models. When `automatic_clustering` is set to `true`, dbt will run an `alter table
resume recluster` query after building the target table. +If [manual clustering is still enabled for your account](https://docs.snowflake.com/en/user-guide/tables-clustering-manual.html), you can use the `automatic_clustering` config to control whether or not automatic clustering is enabled for dbt models. When `automatic_clustering` is set to `true`, dbt will run an `alter table
resume recluster` query after building the target table. The `automatic_clustering` config can be specified in the `dbt_project.yml` file, or in a model `config()` block.