You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The model cannot be build because the nested column full is not quoted during contract validation step. However, the groups column is correctly quoted. Here is the generated query that causes the issue:
select*from (
select
cast(nullas INT64)
as id,
cast(nullas array<struct<id INT64, name STRING, full ARRAY<STRING>>>)
as`groups`
) as __dbt_sbq
where false andcurrent_timestamp() =current_timestamp()
limit0
Expected Behavior
The dbt-bigquery adapter should quote any reference of the full column during table schema validation and next steps.
Steps To Reproduce
Open your DBT project
Create the following model_bug.sql:
{{
config(
materialized='table'
)
}}
WITH data AS (
SELECT1AS id, [STRUCT(11AS id, 'Peter'AS name, ['a', 'b', 'c'] AS`full`)] AS`groups`UNION ALLSELECT2AS id, [STRUCT(22AS id, 'Bob'AS name, ['a', 'b', 'c'] AS`full`)] AS`groups`
)
SELECT
id,
`groups`FROM data
Problem: The current _update_nested_column_data_types method may not handle nested records where quoting is necessary (as indicated by the YAML configuration) to correctly represent data types.
Solution: Introducing a quote boolean parameter allows explicit control over whether values within the nested record should be quoted. This aligns the method's behavior with the YAML configuration.
Is this a new bug in dbt-bigquery?
Current Behavior
Hello,
I have the following model that use two reserved keywords groups and full as example:
and the following model schema:
The model cannot be build because the nested column full is not quoted during contract validation step. However, the groups column is correctly quoted. Here is the generated query that causes the issue:
Expected Behavior
The dbt-bigquery adapter should quote any reference of the full column during table schema validation and next steps.
Steps To Reproduce
Open your DBT project
Create the following model_bug.sql:
Relevant log output
No response
Environment
- dbt-cloud: 2024.7.209
Additional Context
No response
The text was updated successfully, but these errors were encountered: