snowplow / dbt-snowplow-mobile

A fully incremental model, that transforms raw mobile event data generated by the Snowplow mobile trackers into a series of derived tables of varying levels of aggregation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clean up the incremental_manifest table varchar logic

emielver opened this issue · comments

Describe the feature

Take advantage of the type_string functionality in the snowplow_utils package to clean up the incremental manifest table logic:

{# Redshift produces varchar(1) column. Fixing char limit #}
{% set type_string = dbt_utils.type_string() %}
{% set type_string = 'varchar(4096)' if type_string == 'varchar' else type_string %}

with prep as (
  select
    cast(null as {{ type_string }}) model,

to

with prep as (
  select
    cast(null as {{ snowplow_utils.type_string(4096) }}) model,