-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADAP-394] support change monitoring for materialized views (#914)
* init push of ADAP-394 * update lots of framework and update to main * updating based on feedback * add changelog * remove in preivew option * fill out changeset and config change classes for specific options * change partition_by and cluster_by to FrozenSet, initial attempt at describe.sql * create utility.py to add bool_setting method, update parse_model_node to use new method * update describe.sql query * update describe sql to be able to create list of cluster by field names * initital attempt at modifying get_alter_materialized_view_as_sql * update to main and add space * initial build out of mini classes for bigquery cluster, partition, auto_refresh in materialized_view dict. still need to fix some mypy issues * remove local package (dbt-bigquery) on `make dev-uninstall` * update changelog entry to encompass all features in this branch * remove alteration to setup/teardown for materialized view materialization * fix spelling error, prepend underscore on base class module to mark as private to its package * update call to relation to include quote and include policies, update case to match convention * update create statement to include partition, cluster, and options clauses * update partition config to align with existing dbt-bigquery table config * update cluster config to align with existing dbt-bigquery table config * update auto refresh config to align with other configs * revert parse results to accept an agate Row * update how defaults are handled * add description option to materialized view since it is handled for tables * add description option to materialized view since it is handled for tables * fix method call chain in parse_relation_results on cluster, partition, and auto_refresh * move PartitionConfig into relation_configs to be used by materialized views, update references * move PartitionConfig into relation_configs to be used by materialized views, update references; add get_materialized_view_options in alignment with get_table_options; fix wild import order; add factory method for materialized views to be used in the jinja template; update expiration timestamp attribute; * update create materialized view to use the relation config * condition on existence of properties before templating them * allow for "drop if exists" functionality via the google sdk * remove unnecessary trailing semicolon * implement replace based on create * implement clustering, partitioning, and auto refresh for materialized views * remove include_policy from BigQueryRelation, it's causing unit tests to fail and is not used at the moment * partition type cannot be queried for materialized views, adjust the describe query and equality check to account for that * add describe_relation for materialized views * break out common utilities into a mixin for materialized view tests * change refresh_interval_minutes from an int to a float to match the bigquery docs * make partition optional on relation results since it cannot be queried yet * initial draft of materialized view change tests * build changeset for materialized view * implement change monitoring for autorefresh and clustering on materialized views, add describe_relation method on BigQueryAdapter for utility * committing to park changes and wrap up other 1.7 items * update describe to use the sdk instead of sql to pick up partition information * basic tests pass * existing change monitoring tests pass * partition change monitoring tests pass * ADAP-940: Add change monitoring for partitioning clause (#962) * committing to park changes and wrap up other 1.7 items * update describe to use the sdk instead of sql to pick up partition information * basic tests pass * existing change monitoring tests pass * partition change monitoring tests pass --------- Co-authored-by: colin-rogers-dbt <[email protected]> * implement PR review feedback * delete empty file * add MV tests for cluster and partition alone, update combined tests to perform all checks --------- Co-authored-by: Mike Alfare <[email protected]> Co-authored-by: Mike Alfare <[email protected]> Co-authored-by: colin-rogers-dbt <[email protected]>
- Loading branch information
1 parent
b06414f
commit e72cc51
Showing
28 changed files
with
1,424 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: "Support change monitoring for materialized views, including: autorefresh, clustering, partitioning" | ||
time: 2023-09-13T13:04:45.761294-05:00 | ||
custom: | ||
Author: McKnight-42 | ||
Issue: "924" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ ignore = | |
E741, | ||
E501, | ||
exclude = tests | ||
per-file-ignores = | ||
*/__init__.py: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from dbt.adapters.bigquery.relation_configs._base import BigQueryBaseRelationConfig | ||
from dbt.adapters.bigquery.relation_configs._cluster import ( | ||
BigQueryClusterConfig, | ||
BigQueryClusterConfigChange, | ||
) | ||
from dbt.adapters.bigquery.relation_configs._materialized_view import ( | ||
BigQueryMaterializedViewConfig, | ||
BigQueryMaterializedViewConfigChangeset, | ||
) | ||
from dbt.adapters.bigquery.relation_configs._options import ( | ||
BigQueryOptionsConfig, | ||
BigQueryOptionsConfigChange, | ||
) | ||
from dbt.adapters.bigquery.relation_configs._partition import ( | ||
PartitionConfig, | ||
BigQueryPartitionConfigChange, | ||
) | ||
from dbt.adapters.bigquery.relation_configs._policies import ( | ||
BigQueryIncludePolicy, | ||
BigQueryQuotePolicy, | ||
) |
Oops, something went wrong.