Skip to main content

Snowplow Normalize Macros

caution

This page is auto-generated from our dbt packages, some information may be incomplete

Snowplow Normalizeโ€‹

Allow Refreshโ€‹

macros/allow_refresh.sql

Description

This macro does not currently have a description.

Details

Code
Source
{% macro allow_refresh() %}
{{ return(adapter.dispatch('allow_refresh', 'snowplow_normalize')()) }}
{% endmacro %}

Depends On

Referenced By

Normalize Eventsโ€‹

macros/normalize_events.sql

Description

A macro to produce a table from base_events_this_run with the input columns, for a single event type

Arguments

  • event_names (array): List of names of the events this table will be filtered to
  • flat_cols (array): List of standard columns from the atomic.events table to include
  • sde_cols (string): Column names for the self-describing event to pull attributes from
  • sde_keys (array): List of list of keys/column names within the self describing event column to include
  • sde_types (array): List of list of types of the values of the keys within the self describing event column (only used in Snowflake)
  • sde_aliases (array): List of prefixes to apply to the respective context column keys to be used as final column names
  • context_cols (array): List of context columns from the atomic.events table to include
  • context_keys (array of arrays): List of lists of keys/column names within the respective context column to include
  • context_types (array of arrays): List of list of types of the values of the keys within the respective context column (only used in Snowflake)
  • context_aliases (array): List of prefixes to apply to the respective context column keys to be used as final column names
  • remove_new_event_check (boolean): A flag to disable the with_new_events part of the macro, to allow for integration tests to run

Details

Code
Source
{% macro normalize_events(event_names, flat_cols = [], sde_cols = [], sde_keys = [], sde_types = [], sde_aliases = [], context_cols = [], context_keys = [], context_types = [], context_aliases = [], remove_new_event_check = false) %}
{{ return(adapter.dispatch('normalize_events', 'snowplow_normalize')(event_names, flat_cols, sde_cols, sde_keys, sde_types, sde_aliases, context_cols, context_keys, context_types, context_aliases, remove_new_event_check)) }}
{% endmacro %}

Depends On

Snakeify Caseโ€‹

macros/snakeify_case.sql

Description

Take a string in camel/pascal case and make it snakecase

Arguments

  • text (string): the text to convert to snakecase

Details

Code
Source
{% macro snakeify_case(text) %}
{{ return(adapter.dispatch('snakeify_case', 'snowplow_normalize')(text)) }}
{% endmacro %}

Referenced By

Users Tableโ€‹

macros/users_table.sql

Description

A macro to produce a users table from the base_events_this_run table, using the latest context values as defined by the collector_tstamp.

Arguments

  • user_id_field (string): The name of the field to use as the unique user_id
  • user_id_sde (string): The name of the SDE column that contains the user_id_field
  • user_id_context (string): The name of the context column that contains the user_id_field, not used if user_id_sde is also provided
  • user_cols (array): List of (user related) context columns from the atomic.events table to include
  • user_keys (array of arrays): List of lists of keys/column names within the respective user context column to include
  • user_types (array of arrays): List of list of types of the values of the keys within the respective user context column (only used in Snowflake)
  • user_id_alias (string): The alias to apply to the user_id_field to help avoid clashes. Must match the unique key in the config
  • flat_cols (array): List of (user related) flat columns from the atomic.events table to include
  • remove_new_event_check (boolean): A flag to disable the with_new_events part of the macro, to allow for integration tests to run

Details

Code
Source
{% macro users_table(user_id_field = 'user_id', user_id_sde = '', user_id_context = '', user_cols = [], user_keys = [], user_types = [], user_id_alias = 'user_id', flat_cols = [], remove_new_event_check = false) %}
{{ return(adapter.dispatch('users_table', 'snowplow_normalize')(user_id_field, user_id_sde, user_id_context, user_cols, user_keys, user_types, user_id_alias, flat_cols, remove_new_event_check)) }}
{% endmacro %}

Depends On

Was this page helpful?