Skip to content

Commit

Permalink
revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-catfritz committed Jan 17, 2024
1 parent c145300 commit 5676b6d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ The following table provides a detailed list of all models materialized within t
| **model** | **description**|
| --------- | -------------- |
| [salesforce_marketing_cloud__email_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__email_overview) | Each record represents an email with aggregated send and event data for each. |
| [salesforce_marketing_cloud__sends_links](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__sends_links) | Each record represents a link and the corresponding send(s). |
| [salesforce_marketing_cloud__sends_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__sends_overview) | Each record represents a send with aggregated event data for each. |
| [salesforce_marketing_cloud__subscriber_lists](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__subscriber_lists) | Each record represents a list and the corresponding subscriber(s). |
| [salesforce_marketing_cloud__subscriber_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__subscriber_overview) | Each record represents a subscriber with aggregated event data for each. |
| [salesforce_marketing_cloud__email_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__email_overview) | Each record provides the performance of an email via `total_*` and `*_rate` metrics. |
| [salesforce_marketing_cloud__events_enhanced](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__event_enhanced) | Each record expands the source events information by pivoting the `event_type` options into boolean fields. Each record also has related send and email information added. |
| [salesforce_marketing_cloud__sends_links](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__sends_links) | Each record provides a link, joined with all corresponding send(s). |
| [salesforce_marketing_cloud__sends_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__sends_overview) | Each record provides the performance of a send via `total_*` and `*_rate` metrics. |
| [salesforce_marketing_cloud__subscriber_lists](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__subscriber_lists) | Each record provides a list, joined with all corresponding subscriber(s). |
| [salesforce_marketing_cloud__subscriber_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__subscriber_overview) | Each record provides an overview of metrics and activity for a subscriber. |
<!--section-end-->

# 🎯 How do I use the dbt package?
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dispatch:

vars:
salesforce_marketing_cloud:
salesforce_marketing_cloud_schema: sfmc_integration_tests_01
salesforce_marketing_cloud_schema: sfmc_integration_tests_06
salesforce_marketing_cloud_email_identifier: "email_data"
salesforce_marketing_cloud_event_identifier: "event_data"
salesforce_marketing_cloud_link_identifier: "link_data"
Expand Down
10 changes: 3 additions & 7 deletions models/salesforce_marketing_cloud__events_enhanced.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
config(
materialized='incremental',
unique_key='event_id',
partition_by={
'field': 'event_date',
'data_type': 'date',
'granularity': 'day'
} if target.type not in ('spark','databricks') else ['event_date'],
cluster_by=['event_date'],
incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',
partition_by={'field': 'event_date', 'data_type': 'date',} if target.type not in ('spark','databricks') else ['event_date'],
cluster_by=['event_date'],
file_format='parquet'
)
}}
Expand All @@ -21,7 +17,7 @@ with events as(

{% if is_incremental() %}
{% if target.type == 'bigquery' %}
cast(event_date as date) >= cast(_dbt_max_partition as date)
where date(event_date) >= date(_dbt_max_partition)
{% else %}
where event_date > (select max(event_date) from {{ this }})
{% endif %}
Expand Down

0 comments on commit 5676b6d

Please sign in to comment.