Skip to content

Commit

Permalink
Fix Spark field extractions
Browse files Browse the repository at this point in the history
  • Loading branch information
agnessnowplow authored and ilias1111 committed Jun 12, 2024
1 parent 256e616 commit e2bb39d
Show file tree
Hide file tree
Showing 15 changed files with 134 additions and 134 deletions.
4 changes: 2 additions & 2 deletions macros/field_extractions/get_app_context_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0

{% macro spark__get_app_context_fields() %}
{% if var('snowplow__enable_application_context', false) %}
, contexts_com_snowplowanalytics_mobile_application_1[0].build::STRING AS app__build
, contexts_com_snowplowanalytics_mobile_application_1[0].version::STRING AS app__version
, cast(contexts_com_snowplowanalytics_mobile_application_1[0].build as STRING) AS app__build
, cast(contexts_com_snowplowanalytics_mobile_application_1[0].version as STRING) AS app__version
{% else %}
, cast(null as {{ dbt.type_string() }}) as app__build
, cast(null as {{ dbt.type_string() }}) as app__version
Expand Down
18 changes: 9 additions & 9 deletions macros/field_extractions/get_app_error_event_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0

{% macro spark__get_app_error_event_fields() %}
{% if var('snowplow__enable_app_errors', false) %}
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.message::STRING AS app_error__message
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.programming_language::STRING AS app_error__programming_language
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.class_name::STRING AS app_error__class_name
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.exception_name::STRING AS app_error__exception_name
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.is_fatal::BOOLEAN AS app_error__is_fatal
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.line_number::INT AS app_error__line_number
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.stack_trace::STRING AS app_error__stack_trace
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.thread_id::INT AS app_error__thread_id
, unstruct_event_com_snowplowanalytics_snowplow_application_error_1.thread_name::STRING AS app_error__thread_name
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.message as STRING) AS app_error__message
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.programming_language as STRING) AS app_error__programming_language
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.class_name as STRING) AS app_error__class_name
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.exception_name as STRING) AS app_error__exception_name
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.is_fatal as BOOLEAN) AS app_error__is_fatal
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.line_number as INT) AS app_error__line_number
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.stack_trace as STRING) AS app_error__stack_trace
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.thread_id as INT) AS app_error__thread_id
, cast(unstruct_event_com_snowplowanalytics_snowplow_application_error_1.thread_name as STRING) AS app_error__thread_name
{% else %}
, cast(null as {{ dbt.type_string() }}) as app_error__message
, cast(null as {{ dbt.type_string() }}) as app_error__programming_language
Expand Down
26 changes: 13 additions & 13 deletions macros/field_extractions/get_browser_context_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0

{% macro spark__get_browser_context_fields() %}
{% if var('snowplow__enable_browser_context', false) %}
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].viewport::STRING AS browser__viewport
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].document_size::STRING AS browser__document_size
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].resolution::STRING AS browser__resolution
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].color_depth::INT AS browser__color_depth
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].device_pixel_ratio::FLOAT AS browser__device_pixel_ratio
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].cookies_enabled::BOOLEAN AS browser__cookies_enabled
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].online::BOOLEAN AS browser__online
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].browser_language::STRING AS browser__browser_language
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].document_language::STRING AS browser__document_language
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].webdriver::BOOLEAN AS browser__webdriver
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].device_memory::INT AS browser__device_memory
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].hardware_concurrency::INT AS browser__hardware_concurrency
, contexts_com_snowplowanalytics_snowplow_browser_context_1[0].tab_id::STRING AS browser__tab_id
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].viewport as STRING) AS browser__viewport
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].document_size as STRING) AS browser__document_size
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].resolution as STRING) AS browser__resolution
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].color_depth as INT) AS browser__color_depth
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].device_pixel_ratio as FLOAT) AS browser__device_pixel_ratio
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].cookies_enabled as BOOLEAN) AS browser__cookies_enabled
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].online as BOOLEAN) AS browser__online
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].browser_language as STRING) AS browser__browser_language
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].document_language as STRING) AS browser__document_language
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].webdriver as BOOLEAN) AS browser__webdriver
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].device_memory as INT) AS browser__device_memory
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].hardware_concurrency as INT) AS browser__hardware_concurrency
, cast(contexts_com_snowplowanalytics_snowplow_browser_context_1[0].tab_id as STRING) AS browser__tab_id
{% else %}
, cast(null as {{ dbt.type_string() }}) as browser__viewport
, cast(null as {{ dbt.type_string() }}) as browser__document_size
Expand Down
2 changes: 1 addition & 1 deletion macros/field_extractions/get_cmp_visible_event_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0

{% macro spark__get_cmp_visible_event_fields() %}
{% if var('snowplow__enable_consent', false) %}
, unstruct_event_com_snowplowanalytics_snowplow_cmp_visible_1.elapsed_time::float as cmp__elapsed_time
, cast(unstruct_event_com_snowplowanalytics_snowplow_cmp_visible_1.elapsed_time as float) as cmp__elapsed_time

{% else %}
, cast(null as {{ dbt.type_float() }}) as cmp__elapsed_time
Expand Down
14 changes: 7 additions & 7 deletions macros/field_extractions/get_consent_event_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0

{% macro spark__get_consent_event_fields() %}
{% if var('snowplow__enable_consent', false) %}
, unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.event_type::STRING as consent__event_type
, unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.basis_for_processing::STRING as consent__basis_for_processing
, unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.consent_url::STRING as consent__consent_url
, unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.consent_version::STRING as consent__consent_version
, unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.consent_scopes::ARRAY<STRING> as consent__consent_scopes
, unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.domains_applied::ARRAY<STRING> as consent__domains_applied
, unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.gdpr_applies::boolean as consent__gdpr_applies
, cast(unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.event_type as STRING) as consent__event_type
, cast(unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.basis_for_processing as STRING) as consent__basis_for_processing
, cast(unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.consent_url as STRING) as consent__consent_url
, cast(unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.consent_version as STRING) as consent__consent_version
, cast(unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.consent_scopes as ARRAY<STRING>) as consent__consent_scopes
, cast(unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.domains_applied as ARRAY<STRING>) as consent__domains_applied
, cast(unstruct_event_com_snowplowanalytics_snowplow_consent_preferences_1.gdpr_applies as boolean) as consent__gdpr_applies
{% else %}
, cast(null as {{ dbt.type_string() }}) as consent__event_type
, cast(null as {{ dbt.type_string() }}) as consent__basis_for_processing
Expand Down
4 changes: 2 additions & 2 deletions macros/field_extractions/get_deep_link_context_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0

{% macro spark__get_deep_link_context_fields() %}
{% if var('snowplow__enable_deep_link_context', false) %}
, contexts_com_snowplowanalytics_mobile_deep_link_1[0].url::STRING AS deep_link__url
, contexts_com_snowplowanalytics_mobile_deep_link_1[0].referrer::STRING AS deep_link__referrer
, cast(contexts_com_snowplowanalytics_mobile_deep_link_1[0].url as STRING) AS deep_link__url
, cast(contexts_com_snowplowanalytics_mobile_deep_link_1[0].referrer as STRING) AS deep_link__referrer

{% else %}
, cast(null as {{ dbt.type_string() }}) as deep_link__url
Expand Down
14 changes: 7 additions & 7 deletions macros/field_extractions/get_geo_context_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0

{% macro spark__get_geo_context_fields() %}
{% if var('snowplow__enable_geolocation_context', false) %}
, contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].latitude::double AS geo__latitude
, contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].longitude::double AS geo__longitude
, contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].latitude_longitude_accuracy::double AS geo__latitude_longitude_accuracy
, contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].altitude::double AS geo__altitude
, contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].altitude_accuracy::double AS geo__altitude_accuracy
, contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].bearing::double AS geo__bearing
, contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].speed::double AS geo__speed
, cast(contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].latitude as double) AS geo__latitude
, cast(contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].longitude as double) AS geo__longitude
, cast(contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].latitude_longitude_accuracy as double) AS geo__latitude_longitude_accuracy
, cast(contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].altitude as double) AS geo__altitude
, cast(contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].altitude_accuracy as double) AS geo__altitude_accuracy
, cast(contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].bearing as double) AS geo__bearing
, cast(contexts_com_snowplowanalytics_snowplow_geolocation_context_1[0].speed as double) AS geo__speed
{% else %}
, cast(null as double) as geo__latitude
, cast(null as double) as geo__longitude
Expand Down
8 changes: 4 additions & 4 deletions macros/field_extractions/get_iab_context_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0

{% macro spark__get_iab_context_fields() %}
{%- if var('snowplow__enable_iab', false) -%}
, contexts_com_iab_snowplow_spiders_and_robots_1[0].category::STRING as iab__category
, contexts_com_iab_snowplow_spiders_and_robots_1[0].primary_impact::STRING as iab__primary_impact
, contexts_com_iab_snowplow_spiders_and_robots_1[0].reason::STRING as iab__reason
, contexts_com_iab_snowplow_spiders_and_robots_1[0].spider_or_robot::BOOLEAN as iab__spider_or_robot
, cast(contexts_com_iab_snowplow_spiders_and_robots_1[0].category as STRING) as iab__category
, cast(contexts_com_iab_snowplow_spiders_and_robots_1[0].primary_impact as STRING) as iab__primary_impact
, cast(contexts_com_iab_snowplow_spiders_and_robots_1[0].reason as STRING) as iab__reason
, cast(contexts_com_iab_snowplow_spiders_and_robots_1[0].spider_or_robot as BOOLEAN) as iab__spider_or_robot
{%- else -%}
, cast(null as {{ dbt.type_string() }}) as iab__category
, cast(null as {{ dbt.type_string() }}) as iab__primary_impact
Expand Down
Loading

0 comments on commit e2bb39d

Please sign in to comment.