Change how a column of type VECTOR is parsed #1169
Open
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.
resolves #1098
docs dbt-labs/docs.getdbt.com/#
Problem
When an incremental (maybe other materializations, but I have not checked) model with a
VECTOR
type is run, it will fail to create theSnowflakeColumn
object from thefrom_description
class method. This is because thedbt-adapters
Column.from_description
method does some parsing to extract the precision and scale of a numeric type and tries to cast both values within parenthesis to integers. The Snowflake vector is of the formVECTOR(<data_type>, <dimension>)
, so the<data_type>
will fail to be cast as an integer.Solution
If the data type has the word
VECTOR
in it, bypass the additional parsing done indbt-adapters
and return aSnowflakeColumn
that uses the raw data type as the parsed data type. If it does not, then pass it through to the defaultfrom_description
method.Checklist