Ensure character columns are treated as string types. #1191
+12
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1194
I was playing around with
dbt archive
and hit the following failure:Tracking this down with debug mode, the column
redacted_uuid char(36),
in the original table definition (Redshift) was getting recreated as"redacted_uuid" character,
in the dbt archive table.Researching this lead me to
schema.py
wherecharacter
columns are not interpreted as string types, therefore no size character length information is used when generating the create table statement.To note, the query to generate columns for dbt returns the following info from my redshift table:
|column_name|data_type|character_maximum_length|numeric_size|
|---------------|---------|--||
|redacted_uuiid|character|36||
I don't know the implications of this change on other databases or functionality but it seems functionally more accurate. Also, I'm fine for the resulting column to be
character varying(size)
as thecharacter
column is generated from an ETL tool so it's a pain to change, which would have been my first quick fix.Happy to adjust or change based on feedback - just throwing this up since it seemed like a valuable quick fix.