-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support column_name and column_schema in BigQuery #2936
Comments
@yu-iskw Thanks for the solid write-up! You're walking onto some well-trodden ground; I'd encourage you to check out some related discussion over in #1438 and #2191. That said, you deserve special commendation for submitting real code :) Both Snowflake and BigQuery support the inclusion of column specifications (including constraints) within CTAs, so I'm totally in favor of adding this as an (optional) feature for both. (On Postgres, Redshift, and other databases, we would instead need to run Rather than adding # schema.yml
models:
- name: my_model
ddl_specifies_schema: true # also proposals to call this `strict`
columns:
- name: required_value
data_type: int64
constraint: not null # or should this be inferred from a `not_null` test?
- name: nullable_value
data_type: string
- name: x
data_type: struct<x1 int64 not null, x2 string>
constraint: not null
- name: y
constraint: array<int64>
description: This is a very interesting column If the
What do you think? |
I'm going to close this, in favor of the more general proposals in the other issues linked above. I'd be happy to re-open and consider implementing within the (now moved) |
Describe the feature
According to the official documentation, the
CREATE TABLE
DDL in BigQuery allows us to define features of columns, such asNOT NULL
. It would be great that dbt users can define schemas with{{ config() }}
.Describe alternatives you've considered
As far as I know, there is no alternative in dbt.
Additional context
The feature is specialized to BigQuery.
CREATE TABLE DDL
Who will this benefit?
All BigQuery users. Especially, we can reduce BigQuery slots to run
not_null
by defining columns withNOT NULL
.Are you interested in contributing this feature?
I want to contribute!
The text was updated successfully, but these errors were encountered: