Skip to content

[Bug] Cluster order for Materialized Views is mixed up #586

@dennishendricks

Description

@dennishendricks

Is this a new bug in dbt-bigquery?

  • I believe this is a new bug in dbt-bigquery
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

After setting clusters for a materialized view via cluster_by in the Config macro, the order of the clusters is not adopted in the appropriate order as with other table forms, but is mixed according to a pattern that is not apparent.

Expected Behavior

Cluster order is adopted 1:1.

Steps To Reproduce

  1. Create a model as "materialized_view"
  2. Set clusters via cluster_by parameter
  3. See mixed cluster order in target -> run folder or result in BigQuery console

Example model:

{{
    config(
        materialized="materialized_view",
        cluster_by=[ "portal", "cu_name", "rt_name", "ids_in_container"],
    )
}}

select * from {{ ref('orders') }}

Result in target folder:

create materialized view if not exists `xxx`
    cluster by rt_name, ids_in_container, portal, cu_name

Relevant log output

No response

Environment

- OS: MacOS Sonoma 14.0
- Python: 3.11.1
- dbt-core: 1.7.8
- dbt-bigquery: 1.7.5

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityA PR, or an issue with a PR, from a community memberfeature:materialized-viewsIssues related to materialized viewspkg:dbt-bigqueryIssue affects dbt-bigquerytriage:quick_support_taskIssues/PRs that support should address due to low complexity and/or high impacttype:bugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions