dbt-labs / dbt-labs/docs.getdbt.com

Contract data type of nested and repeated data (`ARRAY` of `STRUCT`s) in BigQuery

Open
#6,645 0 comments 2 reactions 0 assignees View on GitHub
content improvement
Dominant language
JavaScript
Stars
215
Forks
1.2k
Avg merge
1d 15h
Merged PRs (30d)
130

Description

### Contributions

- [X] I have read the contribution docs, and understand what's expected of me.

### Link to the page on docs.getdbt.com requiring updates

Here's a couple possibilities:
- https://docs.getdbt.com/reference/resource-configs/contract
- https://docs.getdbt.com/reference/resource-configs/bigquery-configs

If the former, then the idea would be a section similar to https://docs.getdbt.com/reference/resource-configs/contract#size-precision-and-scale.

### What part(s) of the page would you like to see updated?

The contract `data_type` of a [nested and repeated fields in BigQuery](https://cloud.google.com/bigquery/docs/best-practices-performance-nested#using_nested_and_repeated_fields) should just be `array` like this:

```yaml
- name: repeated_struct.nested_repeated_struct
data_type: array
```

rather than have the full detailed data type like this:
```yaml
- name: repeated_struct.nested_repeated_struct
data_type: array>
```

### Additional information

See discussion here for background: https://github.com/dbt-labs/dbt-codegen/issues/190#issuecomment-2536512027

This is spiritually similar to a data type issue that came up with Snowflake as it related to [precision and scale of `NUMERIC`](https://docs.getdbt.com/reference/resource-configs/contract#size-precision-and-scale), but it is a distinct caveat.

Only tangentially related to https://github.com/dbt-labs/docs.getdbt.com/issues/3322.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.