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.
Problem
The Snowflake schema uses the
variant
data type for the JSON columnsevent_properties
andsource_properties
. However, dbt interprets these columns asvarchar
, and explicitly setting the column data type in the seed configuration results in an error.Changes
integration_tests
package so that all models target the same identifier.target.type == 'snowflake'
. The shim usesparse_json
to convert JSON columns tovariant
.fullstory_events_integration_tests
tofullstory_events_integration_tests_raw
whentarget.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.