[CT-736] [CT-735] varchar column reduces in size on an incremental run which leads to "Value too long for character type" error #5351
Labels
bug
Something isn't working
help_wanted
Trickier changes, with a clear starting point, good for previous/experienced contributors
incremental
Incremental modeling with dbt
Team:Adapters
Issues designated for the adapter area of the code
Describe the bug
I have an incremental model with the following properties:
The first fresh run worked fine. One of the column named
platform
(which is built from a case-when statement) was detected automatically by dbt to be of typevarchar(20)
.On the next incremental run,
platform
column of the new portion of data only had strings of maximum 17 characters. This led to dbt trying to perform a column type change on redshift fromvarchar(20)
tovarchar(17)
, and got this error:Steps To Reproduce
platform
column build from case-when in the incremental modelExpected behavior
The new column type should be big enough to hold both new and old values
Screenshots and log output
From dbt log file:
System information
The output of
dbt --version
:The operating system you're using: MacOS 12.3.1
The output of
python --version
: Python 3.8.9The text was updated successfully, but these errors were encountered: