Hello. I’m new using dbt and Bigquery as datawarehouse.
I’d like to keep the schema including types parameteres between models …
What I’ve already tried
i have a source table , called T, with a field of type STRING(30)
The output of this model in Bigquery is another table with a field of type STRING
and not STRING(30)
it is possible to generate in dbt with BigQuery a STRING(30) field as the result of a model?
Bigquery does not support casting with parameter types…
SELECT “1” as STRING(30) does not work
so a sql "create or replace table as select … " does not work.
I have already tested in Bigquery using contracts and defining every columns.
Maybe a new feature of dbt for Bigquery is to use the contract info to validate and create the target table with the contract info.
Forcing the contract in the dbt model, dbt create the target model column ,materialized as table, with the expected data_type and with the type parameter .