Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added partition and cluster support to BigQuery materialized view #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions materialized-views/macros/bigquery/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
{%- set refresh_interval_minutes = config.get('refresh_interval_minutes', none) -%}
{%- set sql_header = config.get('sql_header', none) -%}

{%- set raw_partition_by = config.get('partition_by', none) -%}
{%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}
{%- set raw_cluster_by = config.get('cluster_by', none) -%}

{{ sql_header if sql_header is not none }}

create materialized view {{relation}}
{{ partition_by(partition_config) }}
{{ cluster_by(raw_cluster_by) }}
{{ dbt_labs_materialized_views.bigquery_options(
enable_refresh=enable_refresh,
refresh_interval_minutes=refresh_interval_minutes
Expand Down