dbt-labs / dbt-labs/dbt

[CT-2625] Support model contracts + constraints with nested fields in core

Open
#7,759 3 comments 0 reactions 0 assignees View on GitHub
engine:v1 model_contracts multi_project type:tech-debt
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

https://github.com/dbt-labs/dbt-bigquery/pull/738 implemented model contract + constraint support for models with nested fields in BigQuery, but much of the implementation is not specific to any adapter. The adapter-specific piece relates to formatting the nested column type (so [this bit](https://github.com/dbt-labs/dbt-bigquery/pull/738/files#diff-96ff53dca401b9ca48009a58b6c77181552b72b2ad6867c37ae2f22f75a5bd38R418)).

BigQuery's support for nested columns is very thorough - supporting many levels of nesting (up to 100) and constraints on nested columns. Nested columns are not supported with the same maturity across various platforms and so it feels to early to be implement, test, and maintain this spec across all adapters. We could eventually revisit this though - and remove the need for the BigQuery adapter to implement [overrides of `get_empty_schema_sql` and `get_select_subquery` macros](https://github.com/dbt-labs/dbt-bigquery/pull/738/files#diff-ba5d875a4144a1b739519c0133ae7847a58715ca5374e841c06df089894778faR7-R21).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.