-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multi-version support to get_field for bigquery
- Loading branch information
Showing
9 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
integration_tests/models/utils/cross_db/expected_get_field_bq.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{# | ||
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved. | ||
This program is licensed to you under the Snowplow Community License Version 1.0, | ||
and you may not use this file except in compliance with the Snowplow Community License Version 1.0. | ||
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0 | ||
#} | ||
|
||
{{ | ||
config( | ||
tags = ['get_field'], | ||
) | ||
}} | ||
|
||
select 'John' as combined_column |
24 changes: 24 additions & 0 deletions
24
integration_tests/models/utils/cross_db/test_get_field_bq.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{# | ||
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved. | ||
This program is licensed to you under the Snowplow Community License Version 1.0, | ||
and you may not use this file except in compliance with the Snowplow Community License Version 1.0. | ||
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0 | ||
#} | ||
|
||
{{ | ||
config( | ||
tags = ['get_field'], | ||
) | ||
}} | ||
|
||
{% set test_1_actual = snowplow_utils.combine_column_versions(relation=ref('data_combine_column_versions'), | ||
column_prefix='staff_v', | ||
array_index=1) %} | ||
{% if target.type == 'Bigquery' %} | ||
|
||
select | ||
{{snowplow_utils.get_field('staff_v_*', 'first_name', 'a', dbt.type_string(), 0, relation = ref('data_combine_column_versions'))}} as combined_column, | ||
from | ||
{{ref('data_combine_column_versions')}} a | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters