Skip to content

Commit

Permalink
Create test.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
ilias1111 committed Nov 18, 2024
1 parent 325d3dc commit 7dc9d26
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion utils/tests/expected/custom_table_name2_1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags = "snowplow_normalize_incremental",
materialized = "incremental",
unique_key = "event_id",
upsert_date_key = "collector_tstamp",
upsert_date_key = var("snowplow__partition_key"),
partition_by = snowplow_utils.get_value_by_target_type(bigquery_val={
"field": var("snowplow__partition_key"),
"data_type": "timestamp"
Expand Down
2 changes: 1 addition & 1 deletion utils/tests/expected/custom_table_name3_2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags = "snowplow_normalize_incremental",
materialized = "incremental",
unique_key = "event_id",
upsert_date_key = "collector_tstamp",
upsert_date_key = var("snowplow__partition_key"),
partition_by = snowplow_utils.get_value_by_target_type(bigquery_val={
"field": var("snowplow__partition_key"),
"data_type": "timestamp"
Expand Down
2 changes: 1 addition & 1 deletion utils/tests/expected/custom_table_name4_1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags = "snowplow_normalize_incremental",
materialized = "incremental",
unique_key = "event_id",
upsert_date_key = "collector_tstamp",
upsert_date_key = var("snowplow__partition_key"),
partition_by = snowplow_utils.get_value_by_target_type(bigquery_val={
"field": var("snowplow__partition_key"),
"data_type": "timestamp"
Expand Down
2 changes: 1 addition & 1 deletion utils/tests/expected/custom_table_name5_9.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags = "snowplow_normalize_incremental",
materialized = "incremental",
unique_key = "event_id",
upsert_date_key = "collector_tstamp",
upsert_date_key = var("snowplow__partition_key"),
partition_by = snowplow_utils.get_value_by_target_type(bigquery_val={
"field": var("snowplow__partition_key"),
"data_type": "timestamp"
Expand Down
2 changes: 1 addition & 1 deletion utils/tests/expected/custom_table_name6_6.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags = "snowplow_normalize_incremental",
materialized = "incremental",
unique_key = "event_id",
upsert_date_key = "collector_tstamp",
upsert_date_key = var("snowplow__partition_key"),
partition_by = snowplow_utils.get_value_by_target_type(bigquery_val={
"field": var("snowplow__partition_key"),
"data_type": "timestamp"
Expand Down
2 changes: 1 addition & 1 deletion utils/tests/expected/custom_table_name7_6.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags = "snowplow_normalize_incremental",
materialized = "incremental",
unique_key = "event_id",
upsert_date_key = "collector_tstamp",
upsert_date_key = var("snowplow__partition_key"),
partition_by = snowplow_utils.get_value_by_target_type(bigquery_val={
"field": var("snowplow__partition_key"),
"data_type": "timestamp"
Expand Down
2 changes: 1 addition & 1 deletion utils/tests/expected/event_name1_1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags = "snowplow_normalize_incremental",
materialized = "incremental",
unique_key = "event_id",
upsert_date_key = "collector_tstamp",
upsert_date_key = var("snowplow__partition_key"),
partition_by = snowplow_utils.get_value_by_target_type(bigquery_val={
"field": var("snowplow__partition_key"),
"data_type": "timestamp"
Expand Down
30 changes: 15 additions & 15 deletions utils/tests/expected/test_normalized_events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags = "snowplow_normalize_incremental",
materialized = "incremental",
unique_key = "unique_id",
upsert_date_key = "collector_tstamp",
upsert_date_key = var("snowplow__partition_key"),
partition_by = snowplow_utils.get_value_by_target_type(bigquery_val={
"field": var("snowplow__partition_key"),
"data_type": "timestamp"
Expand All @@ -17,9 +17,9 @@

select
event_id
, collector_tstamp
, {{var("snowplow__partition_key")}}
{% if target.type in ['databricks', 'spark'] -%}
, DATE(collector_tstamp) as collector_tstamp_date
, DATE({{var("snowplow__partition_key")}}) as {{var("snowplow__partition_key")}}_date
{%- endif %}
, event_name
, 'itsaprefix_event_name1_1' as event_table_name
Expand All @@ -34,9 +34,9 @@ UNION ALL

select
event_id
, collector_tstamp
, {{var("snowplow__partition_key")}}
{% if target.type in ['databricks', 'spark'] -%}
, DATE(collector_tstamp) as collector_tstamp_date
, DATE({{var("snowplow__partition_key")}}) as {{var("snowplow__partition_key")}}_date
{%- endif %}
, event_name
, 'custom_table_name2_1' as event_table_name
Expand All @@ -51,9 +51,9 @@ UNION ALL

select
event_id
, collector_tstamp
, {{var("snowplow__partition_key")}}
{% if target.type in ['databricks', 'spark'] -%}
, DATE(collector_tstamp) as collector_tstamp_date
, DATE({{var("snowplow__partition_key")}}) as {{var("snowplow__partition_key")}}_date
{%- endif %}
, event_name
, 'custom_table_name3_2' as event_table_name
Expand All @@ -68,9 +68,9 @@ UNION ALL

select
event_id
, collector_tstamp
, {{var("snowplow__partition_key")}}
{% if target.type in ['databricks', 'spark'] -%}
, DATE(collector_tstamp) as collector_tstamp_date
, DATE({{var("snowplow__partition_key")}}) as {{var("snowplow__partition_key")}}_date
{%- endif %}
, event_name
, 'custom_table_name4_1' as event_table_name
Expand All @@ -85,9 +85,9 @@ UNION ALL

select
event_id
, collector_tstamp
, {{var("snowplow__partition_key")}}
{% if target.type in ['databricks', 'spark'] -%}
, DATE(collector_tstamp) as collector_tstamp_date
, DATE({{var("snowplow__partition_key")}}) as {{var("snowplow__partition_key")}}_date
{%- endif %}
, event_name
, 'custom_table_name5_9' as event_table_name
Expand All @@ -102,9 +102,9 @@ UNION ALL

select
event_id
, collector_tstamp
, {{var("snowplow__partition_key")}}
{% if target.type in ['databricks', 'spark'] -%}
, DATE(collector_tstamp) as collector_tstamp_date
, DATE({{var("snowplow__partition_key")}}) as {{var("snowplow__partition_key")}}_date
{%- endif %}
, event_name
, 'custom_table_name6_6' as event_table_name
Expand All @@ -119,9 +119,9 @@ UNION ALL

select
event_id
, collector_tstamp
, {{var("snowplow__partition_key")}}
{% if target.type in ['databricks', 'spark'] -%}
, DATE(collector_tstamp) as collector_tstamp_date
, DATE({{var("snowplow__partition_key")}}) as {{var("snowplow__partition_key")}}_date
{%- endif %}
, event_name
, 'custom_table_name7_6' as event_table_name
Expand Down

0 comments on commit 7dc9d26

Please sign in to comment.