Skip to content
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

Change how a column of type VECTOR is parsed #1169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

achawkins
Copy link

@achawkins achawkins commented Aug 20, 2024

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 the SnowflakeColumn object from the from_description class method. This is because the dbt-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 form VECTOR(<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 in dbt-adapters and return a SnowflakeColumn that uses the raw data type as the parsed data type. If it does not, then pass it through to the default from_description method.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@achawkins achawkins requested a review from a team as a code owner August 20, 2024 21:30
Copy link

cla-bot bot commented Aug 20, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Andrew Hawkins.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Support Vector data types for macro snowflake__get_columns_in_relation
1 participant