-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Bug] Incorrect column data type with incremental contracted model and varchar data_type #10362
Labels
bug
Something isn't working
Comments
gshank
changed the title
Incorrect column data type with incremental contracted model and varchar data_type
[Bug] Incorrect column data type with incremental contracted model and varchar data_type
Jun 25, 2024
I was able to reproduce this for both Both models are the same SQL
yml
logs
|
5 tasks
This was referenced Jul 22, 2024
When using incremental tables, the column data types are invalidly updated
dbt-labs/dbt-adapters#269
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current Behavior
A temporary table is created for incremental models when the table already exists. When this temporary table is created and one of the column contracted data_types is "character varying(1)" (size is not significant) the string size is lost in the creation of the temporary relation and instead the column is altered after the temporary table is created like: alter table "xxx"."xxxx"."xxx" add column "<column_name>__dbt_alter" character varying(256);
The column is created with the wrong string size.
Expected Behavior
The column is created with the string size that's specified in the contract.
Steps to recreate
Create an incremental model, update it with additional rows (causing the creation of a temporary table) and observe the the wrong string size is used.
Additional Context
Reported internally by Lee Bond-Kennedy.
The text was updated successfully, but these errors were encountered: