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

Add shim to correct test seed data types in Snowflake #2

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

craigrmccown
Copy link
Contributor

Problem

The Snowflake schema uses the variant data type for the JSON columns event_properties and source_properties. However, dbt interprets these columns as varchar, and explicitly setting the column data type in the seed configuration results in an error.

Changes

  • Provide a variable to override the table name and set it explicitly in the integration_tests package so that all models target the same identifier.
  • Add a shim model that is only deployed when target.type == 'snowflake'. The shim uses parse_json to convert JSON columns to variant.
  • Alias the fullstory_events_integration_tests to fullstory_events_integration_tests_raw when target.type == 'snowflake'

The result is that, in Snowflake, all views are built on top of the shim view instead of the physical seed table. Other target types are unaffected.

Copy link
Collaborator

@camphillips22 camphillips22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@craigrmccown craigrmccown merged commit 212d27d into main Aug 25, 2023
@craigrmccown craigrmccown deleted the craigmccown/fix-snowflake-intg-tests branch August 25, 2023 15:31
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.

2 participants