-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from fivetran/merged_deals
Merged deals
- Loading branch information
Showing
15 changed files
with
116 additions
and
12 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
deal_id,merged_deal_id,_fivetran_synced | ||
9089908390,9014070905,2023-06-22 11:37:07.210000 | ||
9089908390,9077310858,2023-06-22 11:37:07.210000 | ||
9089908390,9077311778,2023-06-22 11:37:07.210000 | ||
9089908390,9014071335,2023-06-22 11:37:07.210000 | ||
1364146343,10829010820,2023-06-22 11:37:07.220000 | ||
1364146343,10828874842,2023-06-22 11:37:07.220000 | ||
1368273549,10829051678,2023-06-22 11:37:07.227000 | ||
1368273549,10829028256,2023-06-22 11:37:07.227000 | ||
1373595330,10879517198,2023-06-22 11:37:07.227000 | ||
1373595330,10828874855,2023-06-22 11:37:07.227000 | ||
1006463008,10064581040,2023-06-22 11:37:07.213000 | ||
1006463008,9351825260,2023-06-22 11:37:07.213000 | ||
1389291069,12351788138,2023-06-28 11:18:32.940000 | ||
1389291069,13817889862,2023-06-28 11:18:32.939000 |
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,11 @@ | ||
{% macro get_merged_deal_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, | ||
{"name": "deal_id", "datatype": dbt.type_int()}, | ||
{"name": "merged_deal_id", "datatype": dbt.type_int()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled']) and var('hubspot_merged_deal_enabled', False)) }} | ||
|
||
with base as ( | ||
|
||
select * | ||
from {{ ref('stg_hubspot__merged_deal_tmp') }} | ||
|
||
), macro as ( | ||
|
||
select | ||
{{ | ||
fivetran_utils.fill_staging_columns( | ||
source_columns=adapter.get_columns_in_relation(ref('stg_hubspot__merged_deal_tmp')), | ||
staging_columns=get_merged_deal_columns() | ||
) | ||
}} | ||
from base | ||
|
||
), fields as ( | ||
|
||
select | ||
cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, | ||
deal_id, | ||
merged_deal_id | ||
from macro | ||
) | ||
|
||
select * | ||
from fields |
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,4 @@ | ||
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled']) and var('hubspot_merged_deal_enabled', False)) }} | ||
|
||
select {{ dbt_utils.star(source('hubspot','merged_deal')) }} | ||
from {{ var('merged_deal') }} |